blob: 0ef5f7c819a7f0dca55c0795470ed857cb7b9fdd [file] [log] [blame]
Rob Piked6ef6eb2015-06-25 14:36:49 +10001<!--{
2 "Title": "Go 1.5 Release Notes",
3 "Path": "/doc/go1.5",
4 "Template": true
5}-->
6
Rob Pike751eef82015-06-25 16:20:27 +10007
8<h2 id="introduction">Introduction to Go 1.5</h2>
9
10<p>
11The latest Go release, version 1.5,
12is a significant release, including major architectural changes to the implementation.
13Despite that, we expect almost all Go programs to continue to compile and run as before,
14because the release still maintains the Go 1 <a href="/doc/go1compat.html">promise
15of compatibility</a>.
16</p>
17
18<p>
19The biggest developments in the implementation are:
20</p>
21
22<ul>
23
24<li>
25The compiler and runtime are now written entirely in Go (with a little assembler).
26C is no longer involved in the implementation, and so the C compiler that was
27once necessary for building the distribution is gone.
28</li>
29
30<li>
31The garbage collector is now <a href="/s/go14gc">concurrent</a> and provides dramatically lower
32pause times by running, when possible, in parallel with other goroutines.
33</li>
34
35<li>
36By default, Go programs run with <code>GOMAXPROCS</code> set to the
37number of cores available; in prior releases it defaulted to 1.
38</li>
39
40<li>
41Support for <a href="http://golang.org/s/go14internal">internal packages</a>
42is now provided for all repositories, not just the Go core.
43</li>
44
45<li>
46The <code>go</code> command now provides <a href="/s/go15vendor">experimental
47support</a> for "vendoring" external dependencies.
48</li>
49
50</ul>
51
52<p>
53These and a number of other changes to the implementation and tools
54are discussed below.
55</p>
56
57<p>
58The release also contains one small language change involving map literals.
59</p>
60
61<p>
62Finally, the timing of the <a href="/s/releasesched">release</a>
63strays from the usual six-month interval,
64both to provide more time to prepare this major release and to shift the schedule thereafter to
65time the release dates more conveniently.
66</p>
67
68<h2 id="language">Changes to the language</h2>
69
70<h3 id="mapliterals">Map literals</h3>
71
72<p>
73Due to an oversight, the rule that allowed the element type to be elided from slice literals was not
74applied to map keys.
75This has been <a href="/cl/2591">corrected</a> in Go 1.5.
76An example will make this clear: as of Go 1.5, this map literal,
77</p>
78
Rob Piked6ef6eb2015-06-25 14:36:49 +100079<pre>
Rob Pike751eef82015-06-25 16:20:27 +100080m := map[Point]string{
81 Point{29.935523, 52.891566}: "Persepolis",
82 Point{-25.352594, 131.034361}: "Uluru",
83 Point{37.422455, -122.084306}: "Googleplex",
84}
85</pre>
Brad Fitzpatrickfd2642b2015-01-18 16:00:10 -080086
Rob Pike751eef82015-06-25 16:20:27 +100087<p>
88may be written as follows, without the <code>Point</code> type listed explicitly:
89</p>
Robert Griesemer754bb712015-03-20 16:17:13 -070090
Rob Pike751eef82015-06-25 16:20:27 +100091<pre>
92m := map[Point]string{
93 {29.935523, 52.891566}: "Persepolis",
94 {-25.352594, 131.034361}: "Uluru",
95 {37.422455, -122.084306}: "Googleplex",
96}
97</pre>
Brad Fitzpatrickfd2642b2015-01-18 16:00:10 -080098
Rob Pike751eef82015-06-25 16:20:27 +100099<h2 id="implementation">The Implementation</h2>
Russ Coxcbbe9f62015-04-27 19:28:16 -0400100
Rob Pike751eef82015-06-25 16:20:27 +1000101<h3 id="c">No more C</h3>
Brad Fitzpatrickfb7e2442015-05-14 16:02:53 -0700102
Rob Pike751eef82015-06-25 16:20:27 +1000103<p>
104The compiler and runtime are now implemented in Go and assembler, without C.
105The only C source left in the tree is related to testing or to <code>cgo</code>.
106There was a C compiler in the tree in 1.4 and earlier.
107It was used to build the runtime; a custom compiler was necessary in part to
108guarantee the C code would work with the stack management of goroutines.
109Since the runtime is in Go now, there is no need for this C compiler and it is gone.
110Details of the process to eliminate C are discussed <a href="/s/go13compiler">elsewhere</a>.
111</p>
112
113<p>
114The conversion from C was done with the help of custom tools created for the job.
115Most important, the compiler was actually moved by automatic translation of
116the C code into Go.
117It is in effect the same program in a different language.
118It is not a new implementation
119of the compiler so we expect the process will not have introduced new compiler
120bugs.
121An overview of this process is available in the slides for
122<a href="https://talks.golang.org/2015/gogo.slide">this presentation</a>.
123</p>
124
125<h3 id="compiler">Compiler and tools</h3>
126
127<p>
128Independent of but encouraged by the move to Go, the names of the tools have changed.
129The old names <code>6g</code>, <code>8g</code> and so on are gone; instead there
130is just one binary, accessible as <code>go</code> <code>tool</code> <code>compile</code>,
131that compiles Go source into binaries suitable for the architecture and operating system
132specified by <code>$GOARCH</code> and <code>$GOOS</code>.
Rob Pikec418fe72015-06-29 19:51:56 +1000133Similarly, there is now one linker (<code>go</code> <code>tool</code> <code>link</code>)
Rob Pike751eef82015-06-25 16:20:27 +1000134and one assembler (<code>go</code> <code>tool</code> <code>asm</code>).
135The linker was translated automatically from the old C implementation,
136but the assembler is a new native Go implementation discussed
137in more detail below.
138</p>
139
140<p>
141Similar to the drop of the names <code>6g</code>, <code>8g</code>, and so on,
142the output of the compiler and assembler are now given a plain <code>.o</code> suffix
143rather than <code>.8</code>, <code>.6</code>, etc.
144</p>
145
146
147<h3 id="gc">Garbage collector</h3>
148
149<p>
150TODO
151</p>
152
153<h3 id="runtime">Runtime</h3>
154
155<p>
156In Go 1.5, the order in which goroutines are scheduled has been changed.
157The properties of the scheduler were never defined by the language,
158but programs that depended on the scheduling order may be broken
159by this change.
160We have seen a few (erroneous) programs affected by this change.
161If you have programs that implicitly depend on the scheduling
162order, you will need to update them.
163</p>
164
165<p>
166Another potentially breaking change is that the runtime now
167sets the default number of threads to run simultaneously,
168defined by <code>GOMAXPROCS</code>, to the number
169of cores available on the CPU.
170In prior releases it defaulted to 1.
171Programs that do not expect to run with multiple cores may
172break inadvertently.
173They can be updated by removing the restriction or by setting
174<code>GOMAXPROCS</code> explicitly.
175</p>
176
177<h3 id="build">Build</h3>
178
179<p>
180Now that the Go compiler and runtime are implemented in Go, a Go compiler
181must be available to compile the distribution from source.
182Thus, to build the Go core, a working Go distribution must already be in place.
183(Go programmers who do not work on the core are unaffected by this change.)
184Any Go 1.4 or later distribution (including <code>gccgo</code>) will serve.
185For details, see the <a href="/s/go15bootstrap">design document</a>.
186</p>
187
188<h2 id="ports">Ports</h2>
189
190<p>
191Due mostly to the industry's move away the 32-bit x86 architecture,
192the set of binary downloads provided is reduced in 1.5.
193A distribution for the OS X operating system is provided only for the
194<code>amd64</code> architecture, not <code>386</code>.
195Similarly, the ports for Snow Leopard (Apple OS X 10.6) still work but are no
196longer released as a download or maintained since Apple no longer maintains that version
197of the operating system.
198Also, the <code>dragonfly/386</code> port is no longer supported at all
199because DragonflyBSD itself no longer supports the 32-bit 386 architecture.
200</p>
201
202<p>
203There are however several new ports available to be built from source.
204These include <code>darwin/arm</code> and <code>darwin/arm64</code>.
205The new port <code>linux/arm64</code> is mostly in place, but <code>cgo</code>
206is only supported using external linking.
207</p>
208
Rob Pike0ea3f582015-06-26 11:52:21 +1000209<p>
210On FreeBSD, Go 1.5 requires FreeBSD 8-STABLE+ because of its new use of the <code>SYSCALL</code> instruction.
211</p>
212
213<p>
214On NaCl, Go 1.5 requires SDK version pepper-39 or above because it now uses the
215<code>get_random_bytes</code> system call.
216</p>
217
Rob Pike751eef82015-06-25 16:20:27 +1000218<pre>
Joel Sing3e981d92015-03-14 23:53:31 +1100219
Brad Fitzpatrick0e05bd52015-01-02 14:35:55 -0800220API additions and behavior changes:
221
Rob Pike0d1c0272015-04-13 14:40:09 -0700222flag: new nicer format for PrintDefaults (https://golang.org/cl/7330)
Robert Griesemer754bb712015-03-20 16:17:13 -0700223math/big: add arbitrary precision Floats (many cl's)
Brad Fitzpatrick827a8a562015-04-07 11:59:52 +0200224mime/quotedprintable: new package (https://golang.org/cl/5940 + others)
Sebastien Binet3c939b52015-04-21 17:30:49 +0200225reflect: add ArrayOf (https://golang.org/cl/4111)
Dave Dayf22911f2015-04-16 15:37:51 +1000226reflect: add FuncOf (https://golang.org/cl/1996)
Brad Fitzpatrick0e05bd52015-01-02 14:35:55 -0800227
Rob Pike1a27c072015-01-13 10:16:30 +1100228Tools:
229
Shenghou Ma21aad022015-03-13 22:36:51 -0400230build: external linking support for windows (https://golang.org/cl/7163, 7282, 7283, 7284, 7534, 7535)
Rob Pikecf3ac262015-04-30 17:42:16 -0700231cmd/cover: tool now lives in the standard repository (https://golang.org/cl/9560)
Robert Griesemer2f16ddc2015-04-07 16:20:38 -0700232cmd/gc: constant arithmetic is based on math/big (https://golang.org/cl/7830, 7851, 7857, 8426, 7858, 7912, 8171)
Shenghou Ma214fbd42015-03-12 13:24:24 -0400233cmd/go, go/build: add ${SRCDIR} variable expansion to cgo lines (https://golang.org/cl/1756)
Damian Gryskic754be82015-03-27 10:12:00 +0100234cmd/go: add $DOLLAR to generate's variables (https://golang.org/cl/8091)
Russ Cox271a6502015-02-22 12:48:16 -0500235cmd/go: std wildcard now excludes commands in main repo (https://golang.org/cl/5550)
Ian Lance Taylor73a73e52015-03-06 09:48:08 -0800236cmd/go: .swig/.swigcxx files now require SWIG 3.0.6 or later
Rob Pike63026412015-04-17 10:50:56 -0700237cmd/go: add -run flag to go generate (https://golang.org/cl/9005)
Rob Pike223ab4d2015-04-17 13:34:55 -0700238cmd/go: add $GOLINE to generate's variables (https://golang.org/cl/9007)
Rob Pike181e81c2015-04-27 16:23:43 -0700239cmd/go: add go doc (https://golang.org/cl/9227)
Rob Pike751eef82015-06-25 16:20:27 +1000240cmd/go: internal enforced even outside standard library (golang.org/s/go14internal; https://golang.org/cl/9156)
Rob Pike5b458fb2015-06-20 05:16:50 +1000241cmd/go, testing: add go test -count (https://golang.org/cl/10669)
242cmd/go: add preliminary support for vendor directories (https://golang.org/cl/10923)
Rob Pike1a27c072015-01-13 10:16:30 +1100243cmd/vet: better validation of struct tags (https://golang.org/cl/2685)
Shenghou Ma98376202015-02-02 18:53:24 -0500244cmd/ld: no longer record build timestamp in Windows PE file header (https://golang.org/cl/3740)
Ian Lance Taylor0eadcc82015-04-10 16:47:14 -0700245cmd/go: add -toolexec build option
246cmd/go: drop -ccflags build option
247cmd/go: add -asmflags build option
248cmd/go: add -buildmode build option
249cmd/gc: add -dynlink option (for amd64 only)
250cmd/ld: add -buildmode option
Brad Fitzpatrick715d0172015-02-23 12:17:20 -0800251cmd/trace: new command to view traces (https://golang.org/cl/3601)
Rob Pike751eef82015-06-25 16:20:27 +1000252
Brad Fitzpatrick0e05bd52015-01-02 14:35:55 -0800253Performance:
254
Brad Fitzpatrickf8fd5502015-03-31 06:16:40 -0700255cmd/gc: evaluate concrete == interface without allocating (https://golang.org/cl/2096)
Brad Fitzpatrickfd2642b2015-01-18 16:00:10 -0800256cmd/gc: optimize memclr of slices and arrays (https://golang.org/cl/2520)
Brad Fitzpatrickffc22992015-03-27 14:25:25 +0100257cmd/gc: transform closure calls to function calls (https://golang.org/cl/4050)
Brad Fitzpatrickf8fd5502015-03-31 06:16:40 -0700258cmd/gc: transitive inlining (https://golang.org/cl/5952)
259cmd/gc, runtime: speed up some cases of _, ok := i.(T) (https://golang.org/cl/7697)
260cmd/gc: speed up large string switches (https://golang.org/cl/7698)
261cmd/gc: inline x := y.(*T) and x, ok := y.(*T) (https://golang.org/cl/7862)
262cmd/gc: allocate backing storage for non-escaping interfaces on stack (https://golang.org/cl/8201)
Brad Fitzpatrickffc22992015-03-27 14:25:25 +0100263encoding/xml: avoid an allocation for tags without attributes (https://golang.org/cl/4160)
264image: many optimizations
265runtime: add ARM runtime.cmpstring and bytes.Compare (https://golang.org/cl/8010)
Brad Fitzpatrickfb7e2442015-05-14 16:02:53 -0700266runtime: do not scan maps when k/v do not contain pointers (https://golang.org/cl/3288)
267runtime: reduce thrashing of gs between ps (https://golang.org/cl/9872)
Brad Fitzpatrickfd2642b2015-01-18 16:00:10 -0800268sort: number of Sort performance optimizations (https://golang.org/cl/2100, https://golang.org/cl/2614, ...)
Brad Fitzpatrick0e05bd52015-01-02 14:35:55 -0800269strconv: optimize decimal to string conversion (https://golang.org/cl/2105)
Brad Fitzpatrickffc22992015-03-27 14:25:25 +0100270strconv: optimize float to string conversion (https://golang.org/cl/5600)
271sync: add active spinning to Mutex (https://golang.org/cl/5430)
Robert Griesemerfbe28452015-01-08 13:09:22 -0800272math/big: faster assembly kernels for amd64 and 386 (https://golang.org/cl/2503, https://golang.org/cl/2560)
273math/big: faster "pure Go" kernels for platforms w/o assembly kernels (https://golang.org/cl/2480)
Brad Fitzpatrick2b2f09b2015-03-23 10:49:23 -0700274regexp: port RE2's bitstate backtracker to the regexp package (https://golang.org/cl/2153)
Rob Pike94d0b382015-02-13 15:12:03 -0800275
276Assembler:
277
Ian Lance Taylor0eadcc82015-04-10 16:47:14 -0700278New cmd/asm tool (now use go tool asm, not go tool 6a)
279
280Assembler now supports -dynlink option.
281
Rob Pike94d0b382015-02-13 15:12:03 -0800282ARM assembly syntax has had some features removed.
283
284 - mentioning SP or PC as a hardware register
285 These are always pseudo-registers except that in some contexts
286 they're not, and it's confusing because the context should not affect
287 which register you mean. Change the references to the hardware
288 registers to be explicit: R13 for SP, R15 for PC.
289 - constant creation using assignment
290 The files say a=b when they could instead say #define a b.
291 There is no reason to have both mechanisms.
292 - R(0) to refer to R0.
293 Some macros use this to a great extent. Again, it's easy just to
294 use a #define to rename a register.
295
296Also expression evaluation now uses uint64s instead of signed integers and the
297precedence of operators is now Go-like rather than C-like.
Dmitry Vyukov8cd191b2015-05-30 15:19:56 +0300298
299Standard library hardening
30035 bugs found by randomized testing with go-fuzz (https://github.com/dvyukov/go-fuzz)
301were fixed in fmt, archive/zip, archive/tar, encoding/gob, image/jpeg, image/png,
302image/gif, compress/flate, text/template, html/template. The fixes harden implementation
303against incorrect and malicious inputs.
Rob Piked6ef6eb2015-06-25 14:36:49 +1000304</pre>
Rob Pike751eef82015-06-25 16:20:27 +1000305
306<h3 id="minor_library_changes">Minor changes to the library</h3>
307
308<ul>
309
310<li>
Rob Pikec418fe72015-06-29 19:51:56 +1000311The <a href="/pkg/archive/zip/"><code>archive/zip</code></a> package's
312<a href="/pkg/archive/zip/#Writer"><code>Writer</code></a> type now has a
313<a href="/pkg/archive/zip/#Writer.SetOffset"><code>SetOffset</code></a>
314method to specify the location within the output stream at which to write the archive.
Rob Pike751eef82015-06-25 16:20:27 +1000315</li>
316
317<li>
Rob Pikec418fe72015-06-29 19:51:56 +1000318The <a href="/pkg/bufio/#Reader"><code>Reader</code></a> in the
319<a href="/pkg/bufio/"><code>bufio</code></a> package now has a
320<a href="/pkg/bufio/#Reader.Discard"><code>Discard</code></a>
321method to discard data from the input.
Rob Pike751eef82015-06-25 16:20:27 +1000322</li>
323
324<li>
Rob Pikec418fe72015-06-29 19:51:56 +1000325Also in the <a href="/pkg/bytes/"><code>bytes</code></a> package,
326the <a href="/pkg/bytes/#Buffer"><code>Buffer</code></a> type
327now has a <a href="/pkg/bytes/#Buffer.Cap"><code>Cap</code></a> method
328that reports the number of bytes allocated within the buffer.
329Similarly, both the <a href="/pkg/bytes/"><code>bytes</code></a>
330and <a href="/pkg/strings/"><code>strings</code></a> packages,
331the <a href="/pkg/bytes/#Reader"><code>Reader</code></a>
332type now has a <a href="/pkg/bytes/#Reader.Size"><code>Size</code></a>
333method that reports the original length of the underlying slice or string.
Rob Pike751eef82015-06-25 16:20:27 +1000334</li>
335
336<li>
Rob Pikec418fe72015-06-29 19:51:56 +1000337Both the <a href="/pkg/bytes/"><code>bytes</code></a> and
338<a href="/pkg/strings/"><code>strings</code></a> packages
339also now have a <a href="/pkg/bytes/#LastIndexByte"><code>LastIndexByte</code></a>
340function that locates the rightmost byte with that value in the argument.
Rob Pike751eef82015-06-25 16:20:27 +1000341</li>
342
343<li>
344TODO crypto/cipher: clarify what will happen if len(src) != len(dst) for the Stream interface. (https://golang.org/cl/1754)
345</li>
346
347<li>
348TODO crypto/cipher: support non-standard nonce lengths for GCM. (https://golang.org/cl/8946)
349</li>
350
351<li>
352TODO crypto/elliptic: add Name field to CurveParams struct (https://golang.org/cl/2133)
353</li>
354
355<li>
356TODO crypto/elliptic: Unmarshaling points now automatically checks that the point is on the curve (https://golang.org/cl/2421)
357</li>
358
359<li>
360TODO crypto/tls: change default minimum version to TLS 1.0. (https://golang.org/cl/1791)
361</li>
362
363<li>
364TODO crypto/tls: including Certificate Transparency SCTs in the handshake is now supported (https://golang.org/cl/8988)
365</li>
366
367<li>
368TODO crypto/tls: session ticket keys can now be rotated at runtime (https://golang.org/cl/9072)
369</li>
370
371<li>
372TODO crypto/tls: servers will now always call GetCertificate to pick a certificate for a connection when Certificates is empty (https://golang.org/cl/8792)
373</li>
374
375<li>
376TODO crypto/x509: wildcards are now only accepted as the first label (https://golang.org/cl/5691)
377</li>
378
379<li>
380TODO crypto/x509: unknown critical extensions now cause errors in Verify, not when parsing (https://golang.org/cl/9390)
381</li>
382
383<li>
Rob Pikec418fe72015-06-29 19:51:56 +1000384The <a href="/pkg/database/sql/#DB"><code>DB</code></a> type of the
385<a href="/pkg/database/sql/"><code>database/sql</code></a> package
386now has a <a href="/pkg/database/sql/#DB.Stats"><code>Stats</code></a> method
387to retrieve database statistics.
Rob Pike751eef82015-06-25 16:20:27 +1000388</li>
389
390<li>
Rob Pikec418fe72015-06-29 19:51:56 +1000391The <a href="/pkg/encoding/base64/"><code>encoding/base64</code></a> package
392now supports unpadded encodings through two new encoding variables,
393<a href="/pkg/encoding/base64/#RawStdEncoding"><code>RawStdEncoding</code></a> and
394<a href="/pkg/encoding/base64/#RawURLEncoding"><code>RawURLEncoding</code></a>.
Rob Pike751eef82015-06-25 16:20:27 +1000395</li>
396
397<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000398Also in the <a href="/pkg/fmt/"><code>fmt</code></a> package,
399a value of type <a href="/pkg/reflect/#Value"><code>Value</code></a> now
400prints what it holds, rather than use the <code>reflect.Value</code>'s <code>Stringer</code>
401method, which produces things like <code>&lt;int Value&gt;</code>.
Rob Pike751eef82015-06-25 16:20:27 +1000402</li>
403
404<li>
Rob Pikec418fe72015-06-29 19:51:56 +1000405The <a href="/pkg/ast/#EmptyStmt"><code>EmptyStmt</code></a> type
406in the <a href="/pkg/go/ast/"><code>go/ast</code></a> package now
407has a boolean <code>Implicit</code> field that records whether the
408semicolon was implicitly added or was present in the source.
Rob Pike751eef82015-06-25 16:20:27 +1000409</li>
410
411<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000412For forward compatibility the <a href="/pkg/go/build/"><code>go/build</code></a> package
413reserves <code>GOARCH</code> values for a number of architectures that Go might support one day.
414This is not a promise that it will.
Rob Pike751eef82015-06-25 16:20:27 +1000415</li>
416
417<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000418The <a href="/pkg/io/"><code>io</code></a> package
419adds a <a href="/pkg/io/#CopyBuffer"><code>CopyBuffer</code></a> function
420that is like <a href="/pkg/io/#Copy"><code>Copy</code></a> but
421uses a caller-provided buffer, permitting control of allocation and buffer size.
Rob Pike751eef82015-06-25 16:20:27 +1000422</li>
423
424<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000425The <a href="/pkg/log/"><code>log</code></a> package
426has a new <a href="/pkg/log/#LUTC"><code>LUTC</code></a> flag
427that causes time stamps to be printed in the UTC time zone.
428It also adds a <a href="/pkg/log/#SetOutput"><code>SetOutput</code></a> function
429to set the output destination for the standard logger
430and a corresponding method for user-created loggers.
Rob Pike751eef82015-06-25 16:20:27 +1000431</li>
432
433<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000434In Go 1.4, <a href="/pkg/math/#Max"><code>Max</code></a> was not detecting all possible NaN bit patterns.
435This is fixed in Go 1.5, so programs that use <code>math.Max</code> on data including NaNs may behave differently,
436but now correctly according to the IEEE754 definition of NaNs.
Rob Pike751eef82015-06-25 16:20:27 +1000437</li>
438
439<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000440The <a href="/pkg/math/big/"><code>math/big</code></a> package
441adds a new <a href="/pkg/math/big/#Jacobi"><code>Jacobi</code></a>
442function for integers and a new method
443<a href="/pkg/math/big/#Int.ModSqrt"><code>ModSqrt</code></a>
444method for the <a href="/pkg/math/big/#Int"><code>Int</code></a> type.
Rob Pike751eef82015-06-25 16:20:27 +1000445</li>
446
447<li>
Rob Pikec418fe72015-06-29 19:51:56 +1000448The <a href="/pkg/mime/"><code>mime</code></a> package adds an
449<a href="/pkg/mime/#ExtensionsByType"><code>ExtensionsByType</code></a>
450function that returns the MIME extensions know to be associated with a given MIME type.
Rob Pike751eef82015-06-25 16:20:27 +1000451</li>
452
453<li>
454TODO net: add sequential and RFC 6555-compliant TCP dialing (https://golang.org/cl/8768)
455</li>
456
457<li>
458TODO net: add Source field to OpError (https://go-review.googlesource.com/9231)
459</li>
460
461<li>
462TODO net: fix inconsistent errors (https://golang.org/cl/9236)
463</li>
464
465<li>
466TODO net: add SocketConn, SocketPacketConn (https://golang.org/cl/9275)
467</li>
468
469<li>
470TODO net: use Go's DNS resolver when system configuration permits (https://golang.org/cl/8945)
471</li>
472
473<li>
474TODO net/http: support for setting trailers from a server Handler (https://golang.org/cl/2157)
475</li>
476
477<li>
478TODO net/http: ignore the Unix epoch time in ServeContent (https://golang.org/cl/7915)
479</li>
480
481<li>
482TODO net/http/cgi: fix REMOTE_ADDR, REMOTE_HOST, add REMOTE_PORT (https://golang.org/cl/4933)
483</li>
484
485<li>
486TODO net/mail: adds AddressParser type (https://golang.org/cl/10392)
487</li>
488
489<li>
490TODO net/smtp: add TLSConnectionState accessor (https://golang.org/cl/2151)
491</li>
492
493<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000494The <a href="/pkg/os/"><code>os</code></a> package
495has a new <a href="/pkg/os/#LookupEnv"><code>LookupEnv</code></a> function
496that is similar to <a href="/pkg/os/#Getenv"><code>Getenv</code></a>
497but can distinguish between an empty environment variable and a missing one.
Rob Pike751eef82015-06-25 16:20:27 +1000498</li>
499
500<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000501The <a href="/pkg/os/signal/"><code>os/signal</code></a> package
502adds new <a href="/pkg/os/signal/#Ignore"><code>Ignore</code></a> and
503<a href="/pkg/os/signal/#Reset"><code>Reset</code></a> functions.
Rob Pike751eef82015-06-25 16:20:27 +1000504</li>
505
506<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000507The <a href="/pkg/runtime/pprof/"><code>runtime/pprof</code></a> package
508by default now includes overall memory statistics in all memory profiles.
Rob Pike751eef82015-06-25 16:20:27 +1000509</li>
510
511<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000512The <a href="/pkg/strings/"><code>strings</code></a> package
513has a new <a href="/pkg/strings/#Compare"><code>Compare</code></a> function.
514This is present to provide symmetry with the <a href="/pkg/bytes/"><code>bytes</code></a> package
515but is otherwise unnecessary as strings support comparison natively.
Rob Pike751eef82015-06-25 16:20:27 +1000516</li>
517
518<li>
Rob Pikec418fe72015-06-29 19:51:56 +1000519The <a href="/pkg/sync/#WaitGroup"><code>WaitGroup</code></a> function in
520package <a href="/pkg/sync/"><code>sync</code></a>
521now diagnoses code that races a call to <a href="/pkg/sync/#WaitGroup.Add"><code>Add</code></a>
522against a return from <a href="/pkg/sync/#WaitGroup.Wait"><code>Wait</code></a>.
523If it detects this condition, <code>WaitGroup</code> panics.
524</li>
525
526<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000527In the <a href="/pkg/syscall/"><code>syscall</code></a> package,
528the Linux <code>SysProcAttr</code> struct now has a
529<code>GidMappingsEnableSetgroups</code> field, made necessary
530by security changes in Linux 3.19.
531On all Unix systems, the struct also has new <code>Foreground</code> and <code>Pgid</code> fields
532to provide more control when exec'ing.
533On Darwin, there is now a <code>Syscall9</code> function
534to support calls with too many arguments.
Rob Pike751eef82015-06-25 16:20:27 +1000535</li>
536
537<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000538The <a href="/pkg/testing/quick/"><code>testing/quick</code></a> will now
539generate <code>nil</code> values for pointer types,
540making it possible to use with recursive data structures.
541Also, the package now supports generation of array types.
Rob Pike751eef82015-06-25 16:20:27 +1000542</li>
543
544<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000545In the <a href="/pkg/text/template/"><code>text/template</code></a> and
546<a href="/pkg/html/template/"><code>html/template</code></a> packages,
547integer constants too large to be represented as a Go integer now trigger a
548parse error. Before, they were silently converted to floating point, losing
549precision.
Rob Pike751eef82015-06-25 16:20:27 +1000550</li>
551
552<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000553Also in the <a href="/pkg/text/template/"><code>text/template</code></a> and
554<a href="/pkg/html/template/"><code>html/template</code></a> packages,
555a new <a href="/pkg/text/template/#Option"><code>Option</code></a> type
556allows customization of the behavior of the template during execution.
557The sole implemented option allows control over how a missing key is
558handled when indexing a map.
559The default, which can now be overridden, is as before: to continue with an invalid value.
Rob Pike751eef82015-06-25 16:20:27 +1000560</li>
561
562<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000563The <a href="/pkg/time/"><code>time</code></a> package's
564<code>Time</code> type has a new method
565<a href="/pkg/time/#Time.AppendFormat"><code>AppendFormat</code></a>,
566which can be used to avoid allocation when printing a time value.
Rob Pike751eef82015-06-25 16:20:27 +1000567</li>
568
569<li>
Rob Pike0ea3f582015-06-26 11:52:21 +1000570The <a href="/pkg/unicode/"><code>unicode</code></a> package and associated
571support throughout the system has been upgraded from version 7.0 to
572<a href="http://www.unicode.org/versions/Unicode8.0.0/">Unicode 8.0</a>.
Rob Pike751eef82015-06-25 16:20:27 +1000573</li>
574
575</ul>