@@ -35,15 +35,16 @@ <h2 id="introduction">DRAFT RELEASE NOTES - Introduction to Go 1.8</h2>
35
35
< a href ="#compiler "> updates the compiler back end</ a > to generate more efficient code,
36
36
< a href ="#gc "> reduces GC pauses</ a > by eliminating stop-the-world stack rescanning,
37
37
< a href ="#h2push "> adds HTTP/2 Push support</ a > ,
38
- < a href ="#httpshutdown "> adds HTTP graceful shutdown</ a > ,
38
+ < a href ="#http_shutdown "> adds HTTP graceful shutdown</ a > ,
39
+ < a href ="#more_context "> more context support</ a > ,
39
40
and < a href ="#sort "> simplifies sorting slices</ a > .
40
41
</ p >
41
42
42
43
< h2 id ="language "> Changes to the language</ h2 >
43
44
44
45
< p >
45
46
When explicitly converting structs, tags are now ignored for structural type identity.
46
- See < a href ="/ref/spec#Conversions "> language specification</ a > for details.
47
+ See the < a href ="/ref/spec#Conversions "> language specification</ a > for details.
47
48
</ p >
48
49
49
50
< p > <!-- CL 17711 -->
@@ -74,7 +75,7 @@ <h2 id="ports">Ports</h2>
74
75
75
76
< p >
76
77
Go 1.8 now only supports OS X 10.8 or later. This is likely the last
77
- Go release to continue supporting 10.8. Compiling Go or running
78
+ Go release to support 10.8. Compiling Go or running
78
79
binaries on older OS X versions is untested.
79
80
</ p >
80
81
@@ -229,7 +230,7 @@ <h3 id="compiler">Compiler Toolchain</h3>
229
230
< p >
230
231
In addition to enabling the new compiler back end for all systems,
231
232
Go 1.8 also introduces a new compiler front end. The new compiler
232
- front end should not be noticeable to users is the foundation for
233
+ front end should not be noticeable to users but is the foundation for
233
234
future performance work.
234
235
</ p >
235
236
@@ -252,14 +253,15 @@ <h3 id="gccgo">Gccgo</h3>
252
253
< h3 id ="cmd_go "> Go command</ h3 >
253
254
254
255
< p >
255
- The < a href ="/cmd/go/ "> < code > go</ code > </ a > command 's basic operation
256
- is unchanged, but there are a number of changes worth noting.
256
+ The < a href ="/cmd/go/ "> < code > go</ code > command </ a > 's basic operation
257
+ is unchanged, but there is one addition worth noting.
257
258
</ p >
258
259
259
260
< p >
260
- A new
261
+ The new
261
262
“< a href ="/cmd/go/#hdr-Print_information_for_bug_reports "> < code > go</ code >
262
- < code > bug</ code > </ a > ” command helps users file bug reports.
263
+ < code > bug</ code > </ a > ” starts a bug report on GitHub, prefilled
264
+ with information about the current system.
263
265
</ p >
264
266
265
267
< h3 id ="cmd_doc "> Go doc</ h3 >
@@ -274,14 +276,15 @@ <h3 id="cmd_doc">Go doc</h3>
274
276
</ p >
275
277
276
278
< p > <!-- CL 25420 -->
277
- In order to improve the readability of the < code > doc</ code > 's
279
+ In order to improve the readability of < code > doc</ code > 's
278
280
output, each summary of the first-level items is guaranteed to
279
281
occupy a single line.
280
282
</ p >
281
283
282
284
< p > <!-- CL 31852 -->
283
- Documentation for interface methods is now only shown when requested
284
- explicitly.
285
+ Documentation for a specific method in an interface definition can
286
+ now be requested, as in
287
+ “< code > go</ code > < code > doc</ code > < code > net.Conn.SetDeadline</ code > ”.
285
288
</ p >
286
289
287
290
< h3 id ="plugin "> Plugins</ h3 >
@@ -307,10 +310,14 @@ <h3 id="liveness">Argument Liveness</h3>
307
310
</ p >
308
311
309
312
< p >
310
- < i > Updating:</ i > Users of finalizers should see the example
311
- in the < a href ="/pkg/runtime/#KeepAlive "> < code > KeepAlive</ code > documentation</ a >
312
- to see where a call to < code > KeepAlive</ code > might be needed.
313
- </ p >
313
+ < i > Updating:</ i >
314
+ Code that sets a finalizer on an allocated object may need to add
315
+ calls to < code > runtime.KeepAlive</ code > in functions or methods
316
+ using that object.
317
+ Read the
318
+ < a href ="/pkg/runtime/#KeepAlive "> < code > KeepAlive</ code >
319
+ documentation</ a > and its example for more details.
320
+ </ p >
314
321
315
322
< h3 id ="memstats "> MemStats Documentation</ h3 >
316
323
@@ -344,8 +351,8 @@ <h3 id="gc">Garbage Collector</h3>
344
351
345
352
< p >
346
353
Garbage collection pauses should be significantly shorter than they
347
- were in Go 1.7, often as low as 10 microseconds and usually under 100
348
- microseconds.
354
+ were in Go 1.7, usually under 100 microseconds and often as low as
355
+ 10 microseconds.
349
356
See the
350
357
< a href ="https://github.com/golang/proposal/blob/master/design/17503-eliminate-rescan.md "
351
358
> document on eliminating stop-the-world stack re-scanning</ a >
@@ -357,7 +364,7 @@ <h3 id="defer">Defer</h3>
357
364
<!-- CL 29656, CL 29656 -->
358
365
< p >
359
366
The overhead of < a href ="/ref/spec/#Defer_statements "> deferred
360
- function calls</ a > has been reduced by half.
367
+ function calls</ a > has been reduced by about half.
361
368
</ p >
362
369
363
370
< h3 id ="cgoperf "> Cgo</ h3 >
@@ -409,11 +416,33 @@ <h3 id="http_shutdown">HTTP Server Graceful Shutdown</h3>
409
416
< p > <!-- CL 32329 -->
410
417
The HTTP Server now has support for graceful shutdown using the new
411
418
< a href ="/pkg/net/http/#Server.Shutdown "> < code > Server.Shutdown</ code > </ a >
412
- method. The related and more abrupt
419
+ method and abrupt shutdown using the new
413
420
< a href ="/pkg/net/http/#Server.Close "> < code > Server.Close</ code > </ a >
414
- is also new.
421
+ method.
422
+ </ p >
423
+
424
+ < h3 id ="more_context "> More Context Support</ h3 >
425
+
426
+ < p >
427
+ Continuing < a href ="/doc/go1.7#context "> Go 1.7's adoption</ a >
428
+ of < a href ="/pkg/context/#Context "> < code > context.Context</ code > </ a >
429
+ into the standard library, Go 1.8 adds more context support
430
+ to existing packages:
415
431
</ p >
416
432
433
+ < ul >
434
+ < li > The new < a href ="/pkg/net/http/#Server.Shutdown "> < code > Server.Shutdown</ code > </ a >
435
+ takes a context argument.</ li >
436
+ < li > There have been < a href ="#database_sql "> significant additions</ a > to the
437
+ < a href ="/pkg/database/sql/ "> database/sql</ a > package with context support.</ li >
438
+ < li > The new < a href ="/pkg/testing/#T.Context "> < code > T.Context</ code > </ a >
439
+ method in the < a href ="/pkg/testing/ "> testing</ a > package now returns a context for
440
+ the active test or benchmark.</ li >
441
+ < li > All nine of the new < code > Lookup</ code > methods on the new
442
+ < a href ="/pkg/net/#Resolver "> < code > net.Resolver</ code > </ a > now
443
+ take a context.</ li >
444
+ </ ul >
445
+
417
446
< h3 id ="minor_library_changes "> Minor changes to the library</ h3 >
418
447
419
448
< p >
@@ -493,8 +522,8 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
493
522
494
523
Similarly,
495
524
the < a href ="/pkg/compress/gzip/#Reader "> < code > Reader</ code > </ a >
496
- now updates the < code > Header.ModTime </ code > field only if the
497
- encoded < code > MTIME </ code > field is non-zero .
525
+ now reports a zero encoded < code > MTIME </ code > field as a zero
526
+ < code > Header.ModTime </ code > .
498
527
</ p >
499
528
500
529
</ dd >
@@ -519,12 +548,11 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
519
548
ending in < code > Context</ code > such as
520
549
< a href ="/pkg/database/sql/#DB.QueryContext "> < code > DB.QueryContext</ code > </ a > and
521
550
< a href ="/pkg/database/sql/#DB.PrepareContext "> < code > DB.PrepareContext</ code > </ a >
522
- that support < code > Context </ code > . By using the new < code > Context</ code > methods it ensures
551
+ that take context arguments. Using the new < code > Context</ code > methods ensures that
523
552
connections are closed and returned to the connection pool when the
524
- request is done. It also enables canceling in-progress queries
525
- should the driver support it. Finally, using the < code > Context</ code >
526
- methods allows the database pool to cancel waiting for the next
527
- available connection.
553
+ request is done; enables canceling in-progress queries
554
+ should the driver support that; and allows the database
555
+ pool to cancel waiting for the next available connection.
528
556
</ p >
529
557
< p >
530
558
The < a href ="/pkg/database/sql#IsolationLevel "> < code > IsolationLevel</ code > </ a >
@@ -541,8 +569,9 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
541
569
which can include SQL type information, column type lengths, and the Go type.
542
570
</ p >
543
571
< p >
544
- Multiple result sets are now supported on Rows. After
545
- < a href ="/pkg/database/sql/#Rows.Next "> < code > Rows.Next</ code > </ a > returns false
572
+ A < a href ="/pkg/database/sql/#Rows "> < code > Rows</ code > </ a >
573
+ can now represent multiple result sets. After
574
+ < a href ="/pkg/database/sql/#Rows.Next "> < code > Rows.Next</ code > </ a > returns false,
546
575
< a href ="/pkg/database/sql/#Rows.NextResultSet "> < code > Rows.NextResultSet</ code > </ a >
547
576
may be called to advance to the next result set. The existing < code > Rows</ code >
548
577
should be continued to be used after it advances to the next result set.
@@ -553,11 +582,14 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
553
582
helps create a < a href ="/pkg/database/sql/#NamedParam "> < code > NamedParam</ code > </ a >
554
583
more succinctly.
555
584
< p >
556
- Drivers that support the new < a href ="/pkg/database/sql/driver/#Pinger "> < code > Pinger</ code > </ a >
557
- interface can now check if the server is still alive when the the
585
+ If a driver supports the new
586
+ < a href ="/pkg/database/sql/driver/#Pinger "> < code > Pinger</ code > </ a >
587
+ interface, the < code > DB</ code > 's
558
588
< a href ="/pkg/database/sql/#DB.Ping "> < code > DB.Ping</ code > </ a >
559
- or < a href ="/pkg/database/sql/#DB.PingContext "> < code > DB.PingContext</ code > </ a >
560
- is called.
589
+ and
590
+ < a href ="/pkg/database/sql/#DB.PingContext "> < code > DB.PingContext</ code > </ a >
591
+ methods will use that interface to check whether a
592
+ database connection is still valid.
561
593
</ p >
562
594
< p >
563
595
The new < code > Context</ code > query methods work for all drivers, but
@@ -619,8 +651,8 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
619
651
</ p >
620
652
621
653
< p > <!-- CL 31932 -->
622
- A < code > nil</ code > < a href ="/pkg/encoding/json/#Marshaler "> < code > Marshaler</ code > </ a >
623
- now marshals as a JSON " < code > null</ code > " value.
654
+ A nil < a href ="/pkg/encoding/json/#Marshaler "> < code > Marshaler</ code > </ a >
655
+ now marshals as a JSON < code > null</ code > value.
624
656
</ p >
625
657
626
658
< p > <!-- CL 21811 -->
@@ -629,17 +661,20 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
629
661
</ p >
630
662
631
663
< p > <!-- CL 30371 -->
632
- Marshal encodes floating-point numbers using the same format as in ES6,
664
+ < a href ="/pkg/encoding/json/#Marshal "> < code > Marshal</ code > </ a >
665
+ encodes floating-point numbers using the same format as in ES6,
633
666
preferring decimal (not exponential) notation for a wider range of values.
634
667
In particular, all floating-point integers up to 2< sup > 64</ sup > format the
635
668
same as the equivalent < code > int64</ code > representation.
636
669
</ p >
637
670
638
671
< p > <!-- CL 30944 -->
639
- Implementations
672
+
673
+ In previous versions of Go, unmarshaling a JSON < code > null</ code > into an
640
674
of < a href ="/pkg/encoding/json/#Unmarshaler "> < code > Unmarshaler</ code > </ a >
641
- are now called with the literal "< code > null</ code > " and can
642
- decide how to handle it.
675
+ was considered a no-op; now the < code > Unmarshaler</ code > 's
676
+ < code > UnmarshalJSON</ code > method is called with the JSON literal
677
+ < code > null</ code > and can define the semantics of that case.
643
678
</ p >
644
679
645
680
</ dd >
@@ -695,12 +730,13 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
695
730
696
731
< p > <!-- CL 27253, CL 33456 -->
697
732
The new < a href ="/pkg/math/rand/#Rand.Uint64 "> < code > Rand.Uint64</ code > </ a >
698
- method returns < code > uint64</ code > values. The
699
- new < a href ="/pkg/math/rand/#Rand. Source64 "> < code > Rand. Source64</ code > </ a >
733
+ method returns < code > uint64</ code > values. The
734
+ new < a href ="/pkg/math/rand/#Source64 "> < code > Source64</ code > </ a >
700
735
interface describes sources capable of generating such values
701
736
directly; otherwise the < code > Rand.Uint64</ code > method
702
737
constructs a < code > uint64</ code > from two calls
703
- to < code > Rand.Source</ code > 's < code > Int63</ code > method.
738
+ to < a href ="/pkg/math/rand/#Source "> < code > Source</ code > </ a > 's
739
+ < code > Int63</ code > method.
704
740
</ p >
705
741
706
742
</ dd >
@@ -713,13 +749,15 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
713
749
The
714
750
< a href ="/pkg/mime/quotedprintable/#Reader "> < code > Reader</ code > </ a > 's
715
751
parsing has been relaxed in two ways to accept
716
- more input seen in the wild. First, it now accepts
717
- a < code > =</ code > sign even if it's not followed by two hex
718
- digits. <!-- CL 32174 -->
752
+ more input seen in the wild.
753
+
754
+ <!-- CL 32174 -->
755
+ First, it accepts an equals sign (< code > =</ code > ) not followed
756
+ by two hex digits as a literal equal sign.
719
757
720
- Second, it accepts a trailing soft line-break at the end of a
721
- message. <!-- CL 27530 --> That is, the final byte of the
722
- message may be a < code > = </ code > sign and it will now be ignored .
758
+ <!-- CL 27530 -->
759
+ Second, it silently ignores a trailing equals sign at the end of
760
+ an encoded input .
723
761
</ p >
724
762
725
763
</ dd >
@@ -926,8 +964,8 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
926
964
< a href ="/pkg/net/url/#URL.Hostname "> < code > URL.Hostname</ code > </ a >
927
965
and
928
966
< a href ="/pkg/net/url/#URL.Port "> < code > URL.Port</ code > </ a >
929
- are accessors to the hostname and port fields of a URL
930
- and deal with the case where the port may or may not be present.
967
+ return the hostname and port fields of a URL,
968
+ correctly handling the case where the port may not be present.
931
969
</ p >
932
970
933
971
< p > <!-- CL 28343 --> The existing method
@@ -961,7 +999,7 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
961
999
< p >
962
1000
The new function
963
1001
< a href ="/pkg/os/#Executable "> < code > Executable</ code > </ a > returns
964
- the running executable path name.
1002
+ the path name of the running executable .
965
1003
</ p >
966
1004
</ dd >
967
1005
</ dl >
0 commit comments