Rob Pike | d6ef6eb | 2015-06-25 14:36:49 +1000 | [diff] [blame] | 1 | <!--{ |
| 2 | "Title": "Go 1.5 Release Notes", |
| 3 | "Path": "/doc/go1.5", |
| 4 | "Template": true |
| 5 | }--> |
| 6 | |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 7 | |
| 8 | <h2 id="introduction">Introduction to Go 1.5</h2> |
| 9 | |
| 10 | <p> |
| 11 | The latest Go release, version 1.5, |
| 12 | is a significant release, including major architectural changes to the implementation. |
| 13 | Despite that, we expect almost all Go programs to continue to compile and run as before, |
| 14 | because the release still maintains the Go 1 <a href="/doc/go1compat.html">promise |
| 15 | of compatibility</a>. |
| 16 | </p> |
| 17 | |
| 18 | <p> |
| 19 | The biggest developments in the implementation are: |
| 20 | </p> |
| 21 | |
| 22 | <ul> |
| 23 | |
| 24 | <li> |
| 25 | The compiler and runtime are now written entirely in Go (with a little assembler). |
| 26 | C is no longer involved in the implementation, and so the C compiler that was |
| 27 | once necessary for building the distribution is gone. |
| 28 | </li> |
| 29 | |
| 30 | <li> |
| 31 | The garbage collector is now <a href="/s/go14gc">concurrent</a> and provides dramatically lower |
| 32 | pause times by running, when possible, in parallel with other goroutines. |
| 33 | </li> |
| 34 | |
| 35 | <li> |
| 36 | By default, Go programs run with <code>GOMAXPROCS</code> set to the |
| 37 | number of cores available; in prior releases it defaulted to 1. |
| 38 | </li> |
| 39 | |
| 40 | <li> |
| 41 | Support for <a href="http://golang.org/s/go14internal">internal packages</a> |
| 42 | is now provided for all repositories, not just the Go core. |
| 43 | </li> |
| 44 | |
| 45 | <li> |
| 46 | The <code>go</code> command now provides <a href="/s/go15vendor">experimental |
| 47 | support</a> for "vendoring" external dependencies. |
| 48 | </li> |
| 49 | |
| 50 | </ul> |
| 51 | |
| 52 | <p> |
| 53 | These and a number of other changes to the implementation and tools |
| 54 | are discussed below. |
| 55 | </p> |
| 56 | |
| 57 | <p> |
| 58 | The release also contains one small language change involving map literals. |
| 59 | </p> |
| 60 | |
| 61 | <p> |
| 62 | Finally, the timing of the <a href="/s/releasesched">release</a> |
| 63 | strays from the usual six-month interval, |
| 64 | both to provide more time to prepare this major release and to shift the schedule thereafter to |
| 65 | time 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> |
| 73 | Due to an oversight, the rule that allowed the element type to be elided from slice literals was not |
| 74 | applied to map keys. |
| 75 | This has been <a href="/cl/2591">corrected</a> in Go 1.5. |
| 76 | An example will make this clear: as of Go 1.5, this map literal, |
| 77 | </p> |
| 78 | |
Rob Pike | d6ef6eb | 2015-06-25 14:36:49 +1000 | [diff] [blame] | 79 | <pre> |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 80 | m := 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 Fitzpatrick | fd2642b | 2015-01-18 16:00:10 -0800 | [diff] [blame] | 86 | |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 87 | <p> |
| 88 | may be written as follows, without the <code>Point</code> type listed explicitly: |
| 89 | </p> |
Robert Griesemer | 754bb71 | 2015-03-20 16:17:13 -0700 | [diff] [blame] | 90 | |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 91 | <pre> |
| 92 | m := 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 Fitzpatrick | fd2642b | 2015-01-18 16:00:10 -0800 | [diff] [blame] | 98 | |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 99 | <h2 id="implementation">The Implementation</h2> |
Russ Cox | cbbe9f6 | 2015-04-27 19:28:16 -0400 | [diff] [blame] | 100 | |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 101 | <h3 id="c">No more C</h3> |
Brad Fitzpatrick | fb7e244 | 2015-05-14 16:02:53 -0700 | [diff] [blame] | 102 | |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 103 | <p> |
| 104 | The compiler and runtime are now implemented in Go and assembler, without C. |
| 105 | The only C source left in the tree is related to testing or to <code>cgo</code>. |
| 106 | There was a C compiler in the tree in 1.4 and earlier. |
| 107 | It was used to build the runtime; a custom compiler was necessary in part to |
| 108 | guarantee the C code would work with the stack management of goroutines. |
| 109 | Since the runtime is in Go now, there is no need for this C compiler and it is gone. |
| 110 | Details of the process to eliminate C are discussed <a href="/s/go13compiler">elsewhere</a>. |
| 111 | </p> |
| 112 | |
| 113 | <p> |
| 114 | The conversion from C was done with the help of custom tools created for the job. |
| 115 | Most important, the compiler was actually moved by automatic translation of |
| 116 | the C code into Go. |
| 117 | It is in effect the same program in a different language. |
| 118 | It is not a new implementation |
| 119 | of the compiler so we expect the process will not have introduced new compiler |
| 120 | bugs. |
| 121 | An 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> |
| 128 | Independent of but encouraged by the move to Go, the names of the tools have changed. |
| 129 | The old names <code>6g</code>, <code>8g</code> and so on are gone; instead there |
| 130 | is just one binary, accessible as <code>go</code> <code>tool</code> <code>compile</code>, |
| 131 | that compiles Go source into binaries suitable for the architecture and operating system |
| 132 | specified by <code>$GOARCH</code> and <code>$GOOS</code>. |
Rob Pike | c418fe7 | 2015-06-29 19:51:56 +1000 | [diff] [blame^] | 133 | Similarly, there is now one linker (<code>go</code> <code>tool</code> <code>link</code>) |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 134 | and one assembler (<code>go</code> <code>tool</code> <code>asm</code>). |
| 135 | The linker was translated automatically from the old C implementation, |
| 136 | but the assembler is a new native Go implementation discussed |
| 137 | in more detail below. |
| 138 | </p> |
| 139 | |
| 140 | <p> |
| 141 | Similar to the drop of the names <code>6g</code>, <code>8g</code>, and so on, |
| 142 | the output of the compiler and assembler are now given a plain <code>.o</code> suffix |
| 143 | rather than <code>.8</code>, <code>.6</code>, etc. |
| 144 | </p> |
| 145 | |
| 146 | |
| 147 | <h3 id="gc">Garbage collector</h3> |
| 148 | |
| 149 | <p> |
| 150 | TODO |
| 151 | </p> |
| 152 | |
| 153 | <h3 id="runtime">Runtime</h3> |
| 154 | |
| 155 | <p> |
| 156 | In Go 1.5, the order in which goroutines are scheduled has been changed. |
| 157 | The properties of the scheduler were never defined by the language, |
| 158 | but programs that depended on the scheduling order may be broken |
| 159 | by this change. |
| 160 | We have seen a few (erroneous) programs affected by this change. |
| 161 | If you have programs that implicitly depend on the scheduling |
| 162 | order, you will need to update them. |
| 163 | </p> |
| 164 | |
| 165 | <p> |
| 166 | Another potentially breaking change is that the runtime now |
| 167 | sets the default number of threads to run simultaneously, |
| 168 | defined by <code>GOMAXPROCS</code>, to the number |
| 169 | of cores available on the CPU. |
| 170 | In prior releases it defaulted to 1. |
| 171 | Programs that do not expect to run with multiple cores may |
| 172 | break inadvertently. |
| 173 | They 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> |
| 180 | Now that the Go compiler and runtime are implemented in Go, a Go compiler |
| 181 | must be available to compile the distribution from source. |
| 182 | Thus, 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.) |
| 184 | Any Go 1.4 or later distribution (including <code>gccgo</code>) will serve. |
| 185 | For details, see the <a href="/s/go15bootstrap">design document</a>. |
| 186 | </p> |
| 187 | |
| 188 | <h2 id="ports">Ports</h2> |
| 189 | |
| 190 | <p> |
| 191 | Due mostly to the industry's move away the 32-bit x86 architecture, |
| 192 | the set of binary downloads provided is reduced in 1.5. |
| 193 | A distribution for the OS X operating system is provided only for the |
| 194 | <code>amd64</code> architecture, not <code>386</code>. |
| 195 | Similarly, the ports for Snow Leopard (Apple OS X 10.6) still work but are no |
| 196 | longer released as a download or maintained since Apple no longer maintains that version |
| 197 | of the operating system. |
| 198 | Also, the <code>dragonfly/386</code> port is no longer supported at all |
| 199 | because DragonflyBSD itself no longer supports the 32-bit 386 architecture. |
| 200 | </p> |
| 201 | |
| 202 | <p> |
| 203 | There are however several new ports available to be built from source. |
| 204 | These include <code>darwin/arm</code> and <code>darwin/arm64</code>. |
| 205 | The new port <code>linux/arm64</code> is mostly in place, but <code>cgo</code> |
| 206 | is only supported using external linking. |
| 207 | </p> |
| 208 | |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 209 | <p> |
| 210 | On FreeBSD, Go 1.5 requires FreeBSD 8-STABLE+ because of its new use of the <code>SYSCALL</code> instruction. |
| 211 | </p> |
| 212 | |
| 213 | <p> |
| 214 | On 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 Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 218 | <pre> |
Joel Sing | 3e981d9 | 2015-03-14 23:53:31 +1100 | [diff] [blame] | 219 | |
Brad Fitzpatrick | 0e05bd5 | 2015-01-02 14:35:55 -0800 | [diff] [blame] | 220 | API additions and behavior changes: |
| 221 | |
Rob Pike | 0d1c027 | 2015-04-13 14:40:09 -0700 | [diff] [blame] | 222 | flag: new nicer format for PrintDefaults (https://golang.org/cl/7330) |
Robert Griesemer | 754bb71 | 2015-03-20 16:17:13 -0700 | [diff] [blame] | 223 | math/big: add arbitrary precision Floats (many cl's) |
Brad Fitzpatrick | 827a8a56 | 2015-04-07 11:59:52 +0200 | [diff] [blame] | 224 | mime/quotedprintable: new package (https://golang.org/cl/5940 + others) |
Sebastien Binet | 3c939b5 | 2015-04-21 17:30:49 +0200 | [diff] [blame] | 225 | reflect: add ArrayOf (https://golang.org/cl/4111) |
Dave Day | f22911f | 2015-04-16 15:37:51 +1000 | [diff] [blame] | 226 | reflect: add FuncOf (https://golang.org/cl/1996) |
Brad Fitzpatrick | 0e05bd5 | 2015-01-02 14:35:55 -0800 | [diff] [blame] | 227 | |
Rob Pike | 1a27c07 | 2015-01-13 10:16:30 +1100 | [diff] [blame] | 228 | Tools: |
| 229 | |
Shenghou Ma | 21aad02 | 2015-03-13 22:36:51 -0400 | [diff] [blame] | 230 | build: external linking support for windows (https://golang.org/cl/7163, 7282, 7283, 7284, 7534, 7535) |
Rob Pike | cf3ac26 | 2015-04-30 17:42:16 -0700 | [diff] [blame] | 231 | cmd/cover: tool now lives in the standard repository (https://golang.org/cl/9560) |
Robert Griesemer | 2f16ddc | 2015-04-07 16:20:38 -0700 | [diff] [blame] | 232 | cmd/gc: constant arithmetic is based on math/big (https://golang.org/cl/7830, 7851, 7857, 8426, 7858, 7912, 8171) |
Shenghou Ma | 214fbd4 | 2015-03-12 13:24:24 -0400 | [diff] [blame] | 233 | cmd/go, go/build: add ${SRCDIR} variable expansion to cgo lines (https://golang.org/cl/1756) |
Damian Gryski | c754be8 | 2015-03-27 10:12:00 +0100 | [diff] [blame] | 234 | cmd/go: add $DOLLAR to generate's variables (https://golang.org/cl/8091) |
Russ Cox | 271a650 | 2015-02-22 12:48:16 -0500 | [diff] [blame] | 235 | cmd/go: std wildcard now excludes commands in main repo (https://golang.org/cl/5550) |
Ian Lance Taylor | 73a73e5 | 2015-03-06 09:48:08 -0800 | [diff] [blame] | 236 | cmd/go: .swig/.swigcxx files now require SWIG 3.0.6 or later |
Rob Pike | 6302641 | 2015-04-17 10:50:56 -0700 | [diff] [blame] | 237 | cmd/go: add -run flag to go generate (https://golang.org/cl/9005) |
Rob Pike | 223ab4d | 2015-04-17 13:34:55 -0700 | [diff] [blame] | 238 | cmd/go: add $GOLINE to generate's variables (https://golang.org/cl/9007) |
Rob Pike | 181e81c | 2015-04-27 16:23:43 -0700 | [diff] [blame] | 239 | cmd/go: add go doc (https://golang.org/cl/9227) |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 240 | cmd/go: internal enforced even outside standard library (golang.org/s/go14internal; https://golang.org/cl/9156) |
Rob Pike | 5b458fb | 2015-06-20 05:16:50 +1000 | [diff] [blame] | 241 | cmd/go, testing: add go test -count (https://golang.org/cl/10669) |
| 242 | cmd/go: add preliminary support for vendor directories (https://golang.org/cl/10923) |
Rob Pike | 1a27c07 | 2015-01-13 10:16:30 +1100 | [diff] [blame] | 243 | cmd/vet: better validation of struct tags (https://golang.org/cl/2685) |
Shenghou Ma | 9837620 | 2015-02-02 18:53:24 -0500 | [diff] [blame] | 244 | cmd/ld: no longer record build timestamp in Windows PE file header (https://golang.org/cl/3740) |
Ian Lance Taylor | 0eadcc8 | 2015-04-10 16:47:14 -0700 | [diff] [blame] | 245 | cmd/go: add -toolexec build option |
| 246 | cmd/go: drop -ccflags build option |
| 247 | cmd/go: add -asmflags build option |
| 248 | cmd/go: add -buildmode build option |
| 249 | cmd/gc: add -dynlink option (for amd64 only) |
| 250 | cmd/ld: add -buildmode option |
Brad Fitzpatrick | 715d017 | 2015-02-23 12:17:20 -0800 | [diff] [blame] | 251 | cmd/trace: new command to view traces (https://golang.org/cl/3601) |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 252 | |
Brad Fitzpatrick | 0e05bd5 | 2015-01-02 14:35:55 -0800 | [diff] [blame] | 253 | Performance: |
| 254 | |
Brad Fitzpatrick | f8fd550 | 2015-03-31 06:16:40 -0700 | [diff] [blame] | 255 | cmd/gc: evaluate concrete == interface without allocating (https://golang.org/cl/2096) |
Brad Fitzpatrick | fd2642b | 2015-01-18 16:00:10 -0800 | [diff] [blame] | 256 | cmd/gc: optimize memclr of slices and arrays (https://golang.org/cl/2520) |
Brad Fitzpatrick | ffc2299 | 2015-03-27 14:25:25 +0100 | [diff] [blame] | 257 | cmd/gc: transform closure calls to function calls (https://golang.org/cl/4050) |
Brad Fitzpatrick | f8fd550 | 2015-03-31 06:16:40 -0700 | [diff] [blame] | 258 | cmd/gc: transitive inlining (https://golang.org/cl/5952) |
| 259 | cmd/gc, runtime: speed up some cases of _, ok := i.(T) (https://golang.org/cl/7697) |
| 260 | cmd/gc: speed up large string switches (https://golang.org/cl/7698) |
| 261 | cmd/gc: inline x := y.(*T) and x, ok := y.(*T) (https://golang.org/cl/7862) |
| 262 | cmd/gc: allocate backing storage for non-escaping interfaces on stack (https://golang.org/cl/8201) |
Brad Fitzpatrick | ffc2299 | 2015-03-27 14:25:25 +0100 | [diff] [blame] | 263 | encoding/xml: avoid an allocation for tags without attributes (https://golang.org/cl/4160) |
| 264 | image: many optimizations |
| 265 | runtime: add ARM runtime.cmpstring and bytes.Compare (https://golang.org/cl/8010) |
Brad Fitzpatrick | fb7e244 | 2015-05-14 16:02:53 -0700 | [diff] [blame] | 266 | runtime: do not scan maps when k/v do not contain pointers (https://golang.org/cl/3288) |
| 267 | runtime: reduce thrashing of gs between ps (https://golang.org/cl/9872) |
Brad Fitzpatrick | fd2642b | 2015-01-18 16:00:10 -0800 | [diff] [blame] | 268 | sort: number of Sort performance optimizations (https://golang.org/cl/2100, https://golang.org/cl/2614, ...) |
Brad Fitzpatrick | 0e05bd5 | 2015-01-02 14:35:55 -0800 | [diff] [blame] | 269 | strconv: optimize decimal to string conversion (https://golang.org/cl/2105) |
Brad Fitzpatrick | ffc2299 | 2015-03-27 14:25:25 +0100 | [diff] [blame] | 270 | strconv: optimize float to string conversion (https://golang.org/cl/5600) |
| 271 | sync: add active spinning to Mutex (https://golang.org/cl/5430) |
Robert Griesemer | fbe2845 | 2015-01-08 13:09:22 -0800 | [diff] [blame] | 272 | math/big: faster assembly kernels for amd64 and 386 (https://golang.org/cl/2503, https://golang.org/cl/2560) |
| 273 | math/big: faster "pure Go" kernels for platforms w/o assembly kernels (https://golang.org/cl/2480) |
Brad Fitzpatrick | 2b2f09b | 2015-03-23 10:49:23 -0700 | [diff] [blame] | 274 | regexp: port RE2's bitstate backtracker to the regexp package (https://golang.org/cl/2153) |
Rob Pike | 94d0b38 | 2015-02-13 15:12:03 -0800 | [diff] [blame] | 275 | |
| 276 | Assembler: |
| 277 | |
Ian Lance Taylor | 0eadcc8 | 2015-04-10 16:47:14 -0700 | [diff] [blame] | 278 | New cmd/asm tool (now use go tool asm, not go tool 6a) |
| 279 | |
| 280 | Assembler now supports -dynlink option. |
| 281 | |
Rob Pike | 94d0b38 | 2015-02-13 15:12:03 -0800 | [diff] [blame] | 282 | ARM 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 | |
| 296 | Also expression evaluation now uses uint64s instead of signed integers and the |
| 297 | precedence of operators is now Go-like rather than C-like. |
Dmitry Vyukov | 8cd191b | 2015-05-30 15:19:56 +0300 | [diff] [blame] | 298 | |
| 299 | Standard library hardening |
| 300 | 35 bugs found by randomized testing with go-fuzz (https://github.com/dvyukov/go-fuzz) |
| 301 | were fixed in fmt, archive/zip, archive/tar, encoding/gob, image/jpeg, image/png, |
| 302 | image/gif, compress/flate, text/template, html/template. The fixes harden implementation |
| 303 | against incorrect and malicious inputs. |
Rob Pike | d6ef6eb | 2015-06-25 14:36:49 +1000 | [diff] [blame] | 304 | </pre> |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 305 | |
| 306 | <h3 id="minor_library_changes">Minor changes to the library</h3> |
| 307 | |
| 308 | <ul> |
| 309 | |
| 310 | <li> |
Rob Pike | c418fe7 | 2015-06-29 19:51:56 +1000 | [diff] [blame^] | 311 | The <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> |
| 314 | method to specify the location within the output stream at which to write the archive. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 315 | </li> |
| 316 | |
| 317 | <li> |
Rob Pike | c418fe7 | 2015-06-29 19:51:56 +1000 | [diff] [blame^] | 318 | The <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> |
| 321 | method to discard data from the input. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 322 | </li> |
| 323 | |
| 324 | <li> |
Rob Pike | c418fe7 | 2015-06-29 19:51:56 +1000 | [diff] [blame^] | 325 | Also in the <a href="/pkg/bytes/"><code>bytes</code></a> package, |
| 326 | the <a href="/pkg/bytes/#Buffer"><code>Buffer</code></a> type |
| 327 | now has a <a href="/pkg/bytes/#Buffer.Cap"><code>Cap</code></a> method |
| 328 | that reports the number of bytes allocated within the buffer. |
| 329 | Similarly, both the <a href="/pkg/bytes/"><code>bytes</code></a> |
| 330 | and <a href="/pkg/strings/"><code>strings</code></a> packages, |
| 331 | the <a href="/pkg/bytes/#Reader"><code>Reader</code></a> |
| 332 | type now has a <a href="/pkg/bytes/#Reader.Size"><code>Size</code></a> |
| 333 | method that reports the original length of the underlying slice or string. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 334 | </li> |
| 335 | |
| 336 | <li> |
Rob Pike | c418fe7 | 2015-06-29 19:51:56 +1000 | [diff] [blame^] | 337 | Both the <a href="/pkg/bytes/"><code>bytes</code></a> and |
| 338 | <a href="/pkg/strings/"><code>strings</code></a> packages |
| 339 | also now have a <a href="/pkg/bytes/#LastIndexByte"><code>LastIndexByte</code></a> |
| 340 | function that locates the rightmost byte with that value in the argument. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 341 | </li> |
| 342 | |
| 343 | <li> |
| 344 | TODO 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> |
| 348 | TODO crypto/cipher: support non-standard nonce lengths for GCM. (https://golang.org/cl/8946) |
| 349 | </li> |
| 350 | |
| 351 | <li> |
| 352 | TODO crypto/elliptic: add Name field to CurveParams struct (https://golang.org/cl/2133) |
| 353 | </li> |
| 354 | |
| 355 | <li> |
| 356 | TODO crypto/elliptic: Unmarshaling points now automatically checks that the point is on the curve (https://golang.org/cl/2421) |
| 357 | </li> |
| 358 | |
| 359 | <li> |
| 360 | TODO crypto/tls: change default minimum version to TLS 1.0. (https://golang.org/cl/1791) |
| 361 | </li> |
| 362 | |
| 363 | <li> |
| 364 | TODO crypto/tls: including Certificate Transparency SCTs in the handshake is now supported (https://golang.org/cl/8988) |
| 365 | </li> |
| 366 | |
| 367 | <li> |
| 368 | TODO crypto/tls: session ticket keys can now be rotated at runtime (https://golang.org/cl/9072) |
| 369 | </li> |
| 370 | |
| 371 | <li> |
| 372 | TODO 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> |
| 376 | TODO crypto/x509: wildcards are now only accepted as the first label (https://golang.org/cl/5691) |
| 377 | </li> |
| 378 | |
| 379 | <li> |
| 380 | TODO crypto/x509: unknown critical extensions now cause errors in Verify, not when parsing (https://golang.org/cl/9390) |
| 381 | </li> |
| 382 | |
| 383 | <li> |
Rob Pike | c418fe7 | 2015-06-29 19:51:56 +1000 | [diff] [blame^] | 384 | The <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 |
| 386 | now has a <a href="/pkg/database/sql/#DB.Stats"><code>Stats</code></a> method |
| 387 | to retrieve database statistics. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 388 | </li> |
| 389 | |
| 390 | <li> |
Rob Pike | c418fe7 | 2015-06-29 19:51:56 +1000 | [diff] [blame^] | 391 | The <a href="/pkg/encoding/base64/"><code>encoding/base64</code></a> package |
| 392 | now 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 Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 395 | </li> |
| 396 | |
| 397 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 398 | Also in the <a href="/pkg/fmt/"><code>fmt</code></a> package, |
| 399 | a value of type <a href="/pkg/reflect/#Value"><code>Value</code></a> now |
| 400 | prints what it holds, rather than use the <code>reflect.Value</code>'s <code>Stringer</code> |
| 401 | method, which produces things like <code><int Value></code>. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 402 | </li> |
| 403 | |
| 404 | <li> |
Rob Pike | c418fe7 | 2015-06-29 19:51:56 +1000 | [diff] [blame^] | 405 | The <a href="/pkg/ast/#EmptyStmt"><code>EmptyStmt</code></a> type |
| 406 | in the <a href="/pkg/go/ast/"><code>go/ast</code></a> package now |
| 407 | has a boolean <code>Implicit</code> field that records whether the |
| 408 | semicolon was implicitly added or was present in the source. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 409 | </li> |
| 410 | |
| 411 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 412 | For forward compatibility the <a href="/pkg/go/build/"><code>go/build</code></a> package |
| 413 | reserves <code>GOARCH</code> values for a number of architectures that Go might support one day. |
| 414 | This is not a promise that it will. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 415 | </li> |
| 416 | |
| 417 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 418 | The <a href="/pkg/io/"><code>io</code></a> package |
| 419 | adds a <a href="/pkg/io/#CopyBuffer"><code>CopyBuffer</code></a> function |
| 420 | that is like <a href="/pkg/io/#Copy"><code>Copy</code></a> but |
| 421 | uses a caller-provided buffer, permitting control of allocation and buffer size. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 422 | </li> |
| 423 | |
| 424 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 425 | The <a href="/pkg/log/"><code>log</code></a> package |
| 426 | has a new <a href="/pkg/log/#LUTC"><code>LUTC</code></a> flag |
| 427 | that causes time stamps to be printed in the UTC time zone. |
| 428 | It also adds a <a href="/pkg/log/#SetOutput"><code>SetOutput</code></a> function |
| 429 | to set the output destination for the standard logger |
| 430 | and a corresponding method for user-created loggers. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 431 | </li> |
| 432 | |
| 433 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 434 | In Go 1.4, <a href="/pkg/math/#Max"><code>Max</code></a> was not detecting all possible NaN bit patterns. |
| 435 | This is fixed in Go 1.5, so programs that use <code>math.Max</code> on data including NaNs may behave differently, |
| 436 | but now correctly according to the IEEE754 definition of NaNs. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 437 | </li> |
| 438 | |
| 439 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 440 | The <a href="/pkg/math/big/"><code>math/big</code></a> package |
| 441 | adds a new <a href="/pkg/math/big/#Jacobi"><code>Jacobi</code></a> |
| 442 | function for integers and a new method |
| 443 | <a href="/pkg/math/big/#Int.ModSqrt"><code>ModSqrt</code></a> |
| 444 | method for the <a href="/pkg/math/big/#Int"><code>Int</code></a> type. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 445 | </li> |
| 446 | |
| 447 | <li> |
Rob Pike | c418fe7 | 2015-06-29 19:51:56 +1000 | [diff] [blame^] | 448 | The <a href="/pkg/mime/"><code>mime</code></a> package adds an |
| 449 | <a href="/pkg/mime/#ExtensionsByType"><code>ExtensionsByType</code></a> |
| 450 | function that returns the MIME extensions know to be associated with a given MIME type. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 451 | </li> |
| 452 | |
| 453 | <li> |
| 454 | TODO net: add sequential and RFC 6555-compliant TCP dialing (https://golang.org/cl/8768) |
| 455 | </li> |
| 456 | |
| 457 | <li> |
| 458 | TODO net: add Source field to OpError (https://go-review.googlesource.com/9231) |
| 459 | </li> |
| 460 | |
| 461 | <li> |
| 462 | TODO net: fix inconsistent errors (https://golang.org/cl/9236) |
| 463 | </li> |
| 464 | |
| 465 | <li> |
| 466 | TODO net: add SocketConn, SocketPacketConn (https://golang.org/cl/9275) |
| 467 | </li> |
| 468 | |
| 469 | <li> |
| 470 | TODO net: use Go's DNS resolver when system configuration permits (https://golang.org/cl/8945) |
| 471 | </li> |
| 472 | |
| 473 | <li> |
| 474 | TODO net/http: support for setting trailers from a server Handler (https://golang.org/cl/2157) |
| 475 | </li> |
| 476 | |
| 477 | <li> |
| 478 | TODO net/http: ignore the Unix epoch time in ServeContent (https://golang.org/cl/7915) |
| 479 | </li> |
| 480 | |
| 481 | <li> |
| 482 | TODO net/http/cgi: fix REMOTE_ADDR, REMOTE_HOST, add REMOTE_PORT (https://golang.org/cl/4933) |
| 483 | </li> |
| 484 | |
| 485 | <li> |
| 486 | TODO net/mail: adds AddressParser type (https://golang.org/cl/10392) |
| 487 | </li> |
| 488 | |
| 489 | <li> |
| 490 | TODO net/smtp: add TLSConnectionState accessor (https://golang.org/cl/2151) |
| 491 | </li> |
| 492 | |
| 493 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 494 | The <a href="/pkg/os/"><code>os</code></a> package |
| 495 | has a new <a href="/pkg/os/#LookupEnv"><code>LookupEnv</code></a> function |
| 496 | that is similar to <a href="/pkg/os/#Getenv"><code>Getenv</code></a> |
| 497 | but can distinguish between an empty environment variable and a missing one. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 498 | </li> |
| 499 | |
| 500 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 501 | The <a href="/pkg/os/signal/"><code>os/signal</code></a> package |
| 502 | adds 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 Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 504 | </li> |
| 505 | |
| 506 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 507 | The <a href="/pkg/runtime/pprof/"><code>runtime/pprof</code></a> package |
| 508 | by default now includes overall memory statistics in all memory profiles. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 509 | </li> |
| 510 | |
| 511 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 512 | The <a href="/pkg/strings/"><code>strings</code></a> package |
| 513 | has a new <a href="/pkg/strings/#Compare"><code>Compare</code></a> function. |
| 514 | This is present to provide symmetry with the <a href="/pkg/bytes/"><code>bytes</code></a> package |
| 515 | but is otherwise unnecessary as strings support comparison natively. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 516 | </li> |
| 517 | |
| 518 | <li> |
Rob Pike | c418fe7 | 2015-06-29 19:51:56 +1000 | [diff] [blame^] | 519 | The <a href="/pkg/sync/#WaitGroup"><code>WaitGroup</code></a> function in |
| 520 | package <a href="/pkg/sync/"><code>sync</code></a> |
| 521 | now diagnoses code that races a call to <a href="/pkg/sync/#WaitGroup.Add"><code>Add</code></a> |
| 522 | against a return from <a href="/pkg/sync/#WaitGroup.Wait"><code>Wait</code></a>. |
| 523 | If it detects this condition, <code>WaitGroup</code> panics. |
| 524 | </li> |
| 525 | |
| 526 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 527 | In the <a href="/pkg/syscall/"><code>syscall</code></a> package, |
| 528 | the Linux <code>SysProcAttr</code> struct now has a |
| 529 | <code>GidMappingsEnableSetgroups</code> field, made necessary |
| 530 | by security changes in Linux 3.19. |
| 531 | On all Unix systems, the struct also has new <code>Foreground</code> and <code>Pgid</code> fields |
| 532 | to provide more control when exec'ing. |
| 533 | On Darwin, there is now a <code>Syscall9</code> function |
| 534 | to support calls with too many arguments. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 535 | </li> |
| 536 | |
| 537 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 538 | The <a href="/pkg/testing/quick/"><code>testing/quick</code></a> will now |
| 539 | generate <code>nil</code> values for pointer types, |
| 540 | making it possible to use with recursive data structures. |
| 541 | Also, the package now supports generation of array types. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 542 | </li> |
| 543 | |
| 544 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 545 | In the <a href="/pkg/text/template/"><code>text/template</code></a> and |
| 546 | <a href="/pkg/html/template/"><code>html/template</code></a> packages, |
| 547 | integer constants too large to be represented as a Go integer now trigger a |
| 548 | parse error. Before, they were silently converted to floating point, losing |
| 549 | precision. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 550 | </li> |
| 551 | |
| 552 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 553 | Also 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, |
| 555 | a new <a href="/pkg/text/template/#Option"><code>Option</code></a> type |
| 556 | allows customization of the behavior of the template during execution. |
| 557 | The sole implemented option allows control over how a missing key is |
| 558 | handled when indexing a map. |
| 559 | The default, which can now be overridden, is as before: to continue with an invalid value. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 560 | </li> |
| 561 | |
| 562 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 563 | The <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>, |
| 566 | which can be used to avoid allocation when printing a time value. |
Rob Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 567 | </li> |
| 568 | |
| 569 | <li> |
Rob Pike | 0ea3f58 | 2015-06-26 11:52:21 +1000 | [diff] [blame] | 570 | The <a href="/pkg/unicode/"><code>unicode</code></a> package and associated |
| 571 | support 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 Pike | 751eef8 | 2015-06-25 16:20:27 +1000 | [diff] [blame] | 573 | </li> |
| 574 | |
| 575 | </ul> |