github.com/varialus/godfly@v0.0.0-20130904042352-1934f9f095ab/doc/devel/release.html (about) 1 <!--{ 2 "Title": "Release History" 3 }--> 4 5 <p>This page summarizes the changes between official stable releases of Go. 6 The <a href="http://code.google.com/p/go/source/list">Mercurial change log</a> 7 has the full details.</p> 8 9 <p>To update to a specific release, use:</p> 10 11 <pre> 12 hg pull 13 hg update <i>tag</i> 14 </pre> 15 16 <h2 id="go1.1">go1.1 (released 2013/05/13)</h2> 17 18 <p> 19 Go 1.1 is a major release of Go. 20 Read the <a href="/doc/go1.1.html">Go 1.1 Release Notes</a> for 21 more information. 22 </p> 23 24 <h3 id="go1.1.minor">Minor revisions</h3> 25 26 <p> 27 go1.1.1 (released 2013/06/13) includes several compiler and runtime bug fixes. 28 See the <a href="https://code.google.com/p/go/source/list?name=release-branch.go1.1&r=43c4a41d24382a56a90e924800c681e435d9e399">change history</a> for details. 29 </p> 30 31 <p> 32 go1.1.2 (released 2013/08/13) includes fixes to the <code>gc</code> compiler 33 and <code>cgo</code>, and the <code>bufio</code>, <code>runtime</code>, 34 <code>syscall</code>, and <code>time</code> packages. 35 See the <a href="https://code.google.com/p/go/source/list?name=release-branch.go1.1&r=a6a9792f94acd4ff686b2bc57383d163608b91cf">change history</a> for details. 36 If you use package syscall's <code>Getrlimit</code> and <code>Setrlimit</code> 37 functions under Linux on the ARM or 386 architectures, please note change 38 <a href="http://golang.org/change/55ac276af5a7">55ac276af5a7</a> 39 that fixes <a href="http://golang.org/issue/5949">issue 5949</a>. 40 </p> 41 42 <h2 id="go1">go1 (released 2012/03/28)</h2> 43 44 <p> 45 Go 1 is a major release of Go that will be stable in the long term. 46 Read the <a href="/doc/go1.html">Go 1 Release Notes</a> for more information. 47 </p> 48 49 <p> 50 It is intended that programs written for Go 1 will continue to compile and run 51 correctly, unchanged, under future versions of Go 1. 52 Read the <a href="/doc/go1compat.html">Go 1 compatibility document</a> for more 53 about the future of Go 1. 54 </p> 55 56 <p> 57 The go1 release corresponds to 58 <code><a href="weekly.html#2012-03-27">weekly.2012-03-27</a></code>. 59 </p> 60 61 <h3 id="go1.minor">Minor revisions</h3> 62 63 <p> 64 go1.0.1 (released 2012/04/25) was issued to 65 <a href="https://code.google.com/p/go/source/detail?r=a890477d3dfb">fix</a> an 66 <a href="https://code.google.com/p/go/issues/detail?id=3545">escape analysis 67 bug</a> that can lead to memory corruption. 68 It also includes several minor code and documentation fixes. 69 </p> 70 71 <p> 72 go1.0.2 (released 2012/06/13) was issued to fix two bugs in the implementation 73 of maps using struct or array keys: 74 <a href="http://code.google.com/p/go/issues/detail?id=3695">issue 3695</a> and 75 <a href="http://code.google.com/p/go/issues/detail?id=3573">issue 3573</a>. 76 It also includes many minor code and documentation fixes. 77 </p> 78 79 <p> 80 go1.0.3 (released 2012/09/21) includes minor code and documentation fixes. 81 </p> 82 83 <p> 84 See the <a href="http://code.google.com/p/go/source/list?name=release-branch.go1">go1 release branch history</a> for the complete list of changes. 85 </p> 86 87 <h2 id="r60">r60 (released 2011/09/07)</h2> 88 89 <p> 90 The r60 release corresponds to 91 <code><a href="weekly.html#2011-08-17">weekly.2011-08-17</a></code>. 92 This section highlights the most significant changes in this release. 93 For a more detailed summary, see the 94 <a href="weekly.html#2011-08-17">weekly release notes</a>. 95 For complete information, see the 96 <a href="http://code.google.com/p/go/source/list?r=release-branch.r60">Mercurial change list</a>. 97 </p> 98 99 <h3 id="r60.lang">Language</h3> 100 101 <p> 102 An "else" block is now required to have braces except if the body of the "else" 103 is another "if". Since gofmt always puts those braces in anyway, 104 gofmt-formatted programs will not be affected. 105 To fix other programs, run gofmt. 106 </p> 107 108 <h3 id="r60.pkg">Packages</h3> 109 110 <p> 111 <a href="/pkg/http/">Package http</a>'s URL parsing and query escaping code 112 (such as <code>ParseURL</code> and <code>URLEscape</code>) has been moved to 113 the new <a href="/pkg/url/">url package</a>, with several simplifications to 114 the names. Client code can be updated automatically with gofix. 115 </p> 116 117 <p> 118 <a href="/pkg/image/">Package image</a> has had significant changes made to the 119 <code>Pix</code> field of struct types such as 120 <a href="/pkg/image/#RGBA">image.RGBA</a> and 121 <a href="/pkg/image/#NRGBA">image.NRGBA</a>. 122 The <a href="/pkg/image/#Image">image.Image</a> interface type has not changed, 123 though, and you should not need to change your code if you don't explicitly 124 refer to <code>Pix</code> fields. For example, if you decode a number of images 125 using the <a href="/pkg/image/jpeg/">image/jpeg</a> package, compose them using 126 <a href="/pkg/image/draw/">image/draw</a>, and then encode the result using 127 <a href="/pkg/img/png">image/png</a>, then your code should still work as 128 before. 129 If your code <i>does</i> refer to <code>Pix</code> fields see the 130 <a href="/doc/devel/weekly.html#2011-07-19">weekly.2011-07-19</a> 131 snapshot notes for how to update your code. 132 </p> 133 134 <p> 135 <a href="/pkg/template/">Package template</a> has been replaced with a new 136 templating package (formerly <code>exp/template</code>). The original template 137 package is still available as <a href="/pkg/old/template/">old/template</a>. 138 The <code>old/template</code> package is deprecated and will be removed. 139 The Go tree has been updated to use the new template package. We encourage 140 users of the old template package to switch to the new one. Code that uses 141 <code>template</code> or <code>exp/template</code> will need to change its 142 import lines to <code>"old/template"</code> or <code>"template"</code>, 143 respectively. 144 </p> 145 146 <h3 id="r60.cmd">Tools</h3> 147 148 <p> 149 <a href="/cmd/goinstall/">Goinstall</a> now uses a new tag selection scheme. 150 When downloading or updating, goinstall looks for a tag or branch with the 151 <code>"go."</code> prefix that corresponds to the local Go version. For Go 152 <code>release.r58</code> it looks for <code>go.r58</code>. For 153 <code>weekly.2011-06-03</code> it looks for <code>go.weekly.2011-06-03</code>. 154 If the specific <code>go.X</code> tag or branch is not found, it chooses the 155 closest earlier version. If an appropriate tag or branch is found, goinstall 156 uses that version of the code. Otherwise it uses the default version selected 157 by the version control system. Library authors are encouraged to use the 158 appropriate tag or branch names in their repositories to make their libraries 159 more accessible. 160 </p> 161 162 <h3 id="r60.minor">Minor revisions</h3> 163 164 <p> 165 r60.1 includes a 166 <a href="http://code.google.com/p/go/source/detail?r=1824581bf62d">linker 167 fix</a>, a pair of 168 <a href="http://code.google.com/p/go/source/detail?r=9ef4429c2c64">goplay</a> 169 <a href="http://code.google.com/p/go/source/detail?r=d42ed8c3098e">fixes</a>, 170 and a <code>json</code> package 171 <a href="http://code.google.com/p/go/source/detail?r=d5e97874fe84">fix</a> and 172 a new 173 <a href="http://code.google.com/p/go/source/detail?r=4f0e6269213f">struct tag 174 option</a>. 175 </p> 176 177 <p> 178 r60.2 179 <a href="http://code.google.com/p/go/source/detail?r=ff19536042ac">fixes</a> 180 a memory leak involving maps. 181 </p> 182 183 <p> 184 r60.3 fixes a 185 <a href="http://code.google.com/p/go/source/detail?r=01fa62f5e4e5">reflect bug</a>. 186 </p> 187 188 <h2 id="r59">r59 (released 2011/08/01)</h2> 189 190 <p> 191 The r59 release corresponds to 192 <code><a href="weekly.html#2011-07-07">weekly.2011-07-07</a></code>. 193 This section highlights the most significant changes in this release. 194 For a more detailed summary, see the 195 <a href="weekly.html#2011-07-07">weekly release notes</a>. 196 For complete information, see the 197 <a href="http://code.google.com/p/go/source/list?r=release-branch.r59">Mercurial change list</a>. 198 </p> 199 200 <h3 id="r59.lang">Language</h3> 201 202 <p> 203 This release includes a language change that restricts the use of 204 <code>goto</code>. In essence, a <code>goto</code> statement outside a block 205 cannot jump to a label inside that block. Your code may require changes if it 206 uses <code>goto</code>. 207 See <a href="http://code.google.com/p/go/source/detail?r=dc6d3cf9279d">this 208 changeset</a> for how the new rule affected the Go tree. 209 </p> 210 211 <h3 id="r59.pkg">Packages</h3> 212 213 <p> 214 As usual, <a href="/cmd/gofix/">gofix</a> will handle the bulk of the rewrites 215 necessary for these changes to package APIs. 216 </p> 217 218 <p> 219 <a href="/pkg/http">Package http</a> has a new 220 <a href="/pkg/http/#FileSystem">FileSystem</a> interface that provides access 221 to files. The <a href="/pkg/http/#FileServer">FileServer</a> helper now takes a 222 <code>FileSystem</code> argument instead of an explicit file system root. By 223 implementing your own <code>FileSystem</code> you can use the 224 <code>FileServer</code> to serve arbitrary data. 225 </p> 226 227 <p> 228 <a href="/pkg/os/">Package os</a>'s <code>ErrorString</code> type has been 229 hidden. Most uses of <code>os.ErrorString</code> can be replaced with 230 <a href="/pkg/os/#NewError">os.NewError</a>. 231 </p> 232 233 <p> 234 <a href="/pkg/reflect/">Package reflect</a> supports a new struct tag scheme 235 that enables sharing of struct tags between multiple packages. 236 In this scheme, the tags must be of the form: 237 </p> 238 <pre> 239 `key:"value" key2:"value2"` 240 </pre> 241 <p> 242 The <a href="/pkg/reflect/#StructField">StructField</a> type's Tag field now 243 has type <a href="/pkg/reflect/#StructTag">StructTag</a>, which has a 244 <code>Get</code> method. Clients of <a href="/pkg/json">json</a> and 245 <a href="/pkg/xml">xml</a> will need to be updated. Code that says 246 </p> 247 <pre> 248 type T struct { 249 X int "name" 250 } 251 </pre> 252 <p> 253 should become 254 </p> 255 <pre> 256 type T struct { 257 X int `json:"name"` // or `xml:"name"` 258 } 259 </pre> 260 <p> 261 Use <a href="/cmd/govet/">govet</a> to identify struct tags that need to be 262 changed to use the new syntax. 263 </p> 264 265 <p> 266 <a href="/pkg/sort/">Package sort</a>'s <code>IntArray</code> type has been 267 renamed to <a href="/pkg/sort/#IntSlice">IntSlice</a>, and similarly for 268 <a href="/pkg/sort/#Float64Slice">Float64Slice</a> and 269 <a href="/pkg/sort/#StringSlice">StringSlice</a>. 270 </p> 271 272 <p> 273 <a href="/pkg/strings/">Package strings</a>'s <code>Split</code> function has 274 itself been split into <a href="/pkg/strings/#Split">Split</a> and 275 <a href="/pkg/strings/#SplitN">SplitN</a>. 276 <code>SplitN</code> is the same as the old <code>Split</code>. 277 The new <code>Split</code> is equivalent to <code>SplitN</code> with a final 278 argument of -1. 279 </p> 280 281 <a href="/pkg/image/draw/">Package image/draw</a>'s 282 <a href="/pkg/image/draw/#Draw">Draw</a> function now takes an additional 283 argument, a compositing operator. 284 If in doubt, use <a href="/pkg/image/draw/#Op">draw.Over</a>. 285 </p> 286 287 <h3 id="r59.cmd">Tools</h3> 288 289 <p> 290 <a href="/cmd/goinstall/">Goinstall</a> now installs packages and commands from 291 arbitrary remote repositories (not just Google Code, Github, and so on). 292 See the <a href="/cmd/goinstall/">goinstall documentation</a> for details. 293 </p> 294 295 <h2 id="r58">r58 (released 2011/06/29)</h2> 296 297 <p> 298 The r58 release corresponds to 299 <code><a href="weekly.html#2011-06-09">weekly.2011-06-09</a></code> 300 with additional bug fixes. 301 This section highlights the most significant changes in this release. 302 For a more detailed summary, see the 303 <a href="weekly.html#2011-06-09">weekly release notes</a>. 304 For complete information, see the 305 <a href="http://code.google.com/p/go/source/list?r=release-branch.r58">Mercurial change list</a>. 306 </p> 307 308 <h3 id="r58.lang">Language</h3> 309 310 <p> 311 This release fixes a <a href="http://code.google.com/p/go/source/detail?r=b720749486e1">use of uninitialized memory in programs that misuse <code>goto</code></a>. 312 </p> 313 314 <h3 id="r58.pkg">Packages</h3> 315 316 <p> 317 As usual, <a href="/cmd/gofix/">gofix</a> will handle the bulk of the rewrites 318 necessary for these changes to package APIs. 319 </p> 320 321 <p> 322 <a href="/pkg/http/">Package http</a> drops the <code>finalURL</code> return 323 value from the <a href="/pkg/http/#Client.Get">Client.Get</a> method. The value 324 is now available via the new <code>Request</code> field on <a 325 href="/pkg/http/#Response">http.Response</a>. 326 Most instances of the type map[string][]string in have been 327 replaced with the new <a href="/pkg/http/#Values">Values</a> type. 328 </p> 329 330 <p> 331 <a href="/pkg/exec/">Package exec</a> has been redesigned with a more 332 convenient and succinct API. 333 </p> 334 335 <p> 336 <a href="/pkg/strconv/">Package strconv</a>'s <a href="/pkg/strconv/#Quote">Quote</a> 337 function now escapes only those Unicode code points not classified as printable 338 by <a href="/pkg/unicode/#IsPrint">unicode.IsPrint</a>. 339 Previously Quote would escape all non-ASCII characters. 340 This also affects the <a href="/pkg/fmt/">fmt</a> package's <code>"%q"</code> 341 formatting directive. The previous quoting behavior is still available via 342 strconv's new <a href="/pkg/strconv/#QuoteToASCII">QuoteToASCII</a> function. 343 </p> 344 345 <p> 346 <a href="/pkg/os/signal/">Package os/signal</a>'s 347 <a href="/pkg/os/#Signal">Signal</a> and 348 <a href="/pkg/os/#UnixSignal">UnixSignal</a> types have been moved to the 349 <a href="/pkg/os/">os</a> package. 350 </p> 351 352 <p> 353 <a href="/pkg/image/draw/">Package image/draw</a> is the new name for 354 <code>exp/draw</code>. The GUI-related code from <code>exp/draw</code> is now 355 located in the <a href="/pkg/exp/gui/">exp/gui</a> package. 356 </p> 357 358 <h3 id="r58.cmd">Tools</h3> 359 360 <p> 361 <a href="/cmd/goinstall/">Goinstall</a> now observes the GOPATH environment 362 variable to build and install your own code and external libraries outside of 363 the Go tree (and avoid writing Makefiles). 364 </p> 365 366 367 <h3 id="r58.minor">Minor revisions</h3> 368 369 <p>r58.1 adds 370 <a href="http://code.google.com/p/go/source/detail?r=293c25943586">build</a> and 371 <a href="http://code.google.com/p/go/source/detail?r=bf17e96b6582">runtime</a> 372 changes to make Go run on OS X 10.7 Lion. 373 </p> 374 375 <h2 id="r57">r57 (released 2011/05/03)</h2> 376 377 <p> 378 The r57 release corresponds to 379 <code><a href="weekly.html#2011-04-27">weekly.2011-04-27</a></code> 380 with additional bug fixes. 381 This section highlights the most significant changes in this release. 382 For a more detailed summary, see the 383 <a href="weekly.html#2011-04-27">weekly release notes</a>. 384 For complete information, see the 385 <a href="http://code.google.com/p/go/source/list?r=release-branch.r57">Mercurial change list</a>. 386 </p> 387 388 <p>The new <a href="/cmd/gofix">gofix</a> tool finds Go programs that use old APIs and rewrites them to use 389 newer ones. After you update to a new Go release, gofix helps make the 390 necessary changes to your programs. Gofix will handle the http, os, and syscall 391 package changes described below, and we will update the program to keep up with 392 future changes to the libraries. 393 Gofix can’t 394 handle all situations perfectly, so read and test the changes it makes before 395 committing them. 396 See <a href="http://blog.golang.org/2011/04/introducing-gofix.html">the gofix blog post</a> for more 397 information.</p> 398 399 <h3 id="r57.lang">Language</h3> 400 401 <p> 402 <a href="/doc/go_spec.html#Receive_operator">Multiple assignment syntax</a> replaces the <code>closed</code> function. 403 The syntax for channel 404 receives allows an optional second assigned value, a boolean value 405 indicating whether the channel is closed. This code: 406 </p> 407 408 <pre> 409 v := <-ch 410 if closed(ch) { 411 // channel is closed 412 } 413 </pre> 414 415 <p>should now be written as:</p> 416 417 <pre> 418 v, ok := <-ch 419 if !ok { 420 // channel is closed 421 } 422 </pre> 423 424 <p><a href="/doc/go_spec.html#Label_scopes">Unused labels are now illegal</a>, just as unused local variables are.</p> 425 426 <h3 id="r57.pkg">Packages</h3> 427 428 <p> 429 <a href="/pkg/gob/">Package gob</a> will now encode and decode values of types that implement the 430 <a href="/pkg/gob/#GobEncoder">GobEncoder</a> and 431 <a href="/pkg/gob/#GobDecoder">GobDecoder</a> interfaces. This allows types with unexported 432 fields to transmit self-consistent descriptions; examples include 433 <a href="/pkg/big/#Int.GobDecode">big.Int</a> and <a href="/pkg/big/#Rat.GobDecode">big.Rat</a>. 434 </p> 435 436 <p> 437 <a href="/pkg/http/">Package http</a> has been redesigned. 438 For clients, there are new 439 <a href="/pkg/http/#Client">Client</a> and <a href="/pkg/http/#Transport">Transport</a> 440 abstractions that give more control over HTTP details such as headers sent 441 and redirections followed. These abstractions make it easy to implement 442 custom clients that add functionality such as <a href="http://code.google.com/p/goauth2/source/browse/oauth/oauth.go">OAuth2</a>. 443 For servers, <a href="/pkg/http/#ResponseWriter">ResponseWriter</a> 444 has dropped its non-essential methods. 445 The Hijack and Flush methods are no longer required; 446 code can test for them by checking whether a specific value implements 447 <a href="/pkg/http/#Hijacker">Hijacker</a> or <a href="/pkg/http/#Flusher">Flusher</a>. 448 The RemoteAddr and UsingTLS methods are replaced by <a href="/pkg/http/#Request">Request</a>'s 449 RemoteAddr and TLS fields. 450 The SetHeader method is replaced by a Header method; 451 its result, of type <a href="/pkg/http/#Header">Header</a>, 452 implements Set and other methods. 453 </p> 454 455 <p> 456 <a href="/pkg/net/">Package net</a> 457 drops the <code>laddr</code> argument from <a href="/pkg/net/#Conn.Dial">Dial</a> 458 and drops the <code>cname</code> return value 459 from <a href="/pkg/net/#LookupHost">LookupHost</a>. 460 The implementation now uses <a href="/cmd/cgo/">cgo</a> to implement 461 network name lookups using the C library getaddrinfo(3) 462 function when possible. This ensures that Go and C programs 463 resolve names the same way and also avoids the OS X 464 application-level firewall. 465 </p> 466 467 <p> 468 <a href="/pkg/os/">Package os</a> 469 introduces simplified <a href="/pkg/os/#File.Open">Open</a> 470 and <a href="/pkg/os/#File.Create">Create</a> functions. 471 The original Open is now available as <a href="/pkg/os/#File.OpenFile">OpenFile</a>. 472 The final three arguments to <a href="/pkg/os/#Process.StartProcess">StartProcess</a> 473 have been replaced by a pointer to a <a href="/pkg/os/#ProcAttr">ProcAttr</a>. 474 </p> 475 476 <p> 477 <a href="/pkg/reflect/">Package reflect</a> has been redesigned. 478 <a href="/pkg/reflect/#Type">Type</a> is now an interface that implements 479 all the possible type methods. 480 Instead of a type switch on a Type <code>t</code>, switch on <code>t.Kind()</code>. 481 <a href="/pkg/reflect/#Value">Value</a> is now a struct value that 482 implements all the possible value methods. 483 Instead of a type switch on a Value <code>v</code>, switch on <code>v.Kind()</code>. 484 Typeof and NewValue are now called <a href="/pkg/reflect/#Type.TypeOf">TypeOf</a> and <a href="/pkg/reflect/#Value.ValueOf">ValueOf</a> 485 To create a writable Value, use <code>New(t).Elem()</code> instead of <code>Zero(t)</code>. 486 See <a href="http://code.google.com/p/go/source/detail?r=843855f3c026">the change description</a> 487 for the full details. 488 The new API allows a more efficient implementation of Value 489 that avoids many of the allocations required by the previous API. 490 </p> 491 492 <p> 493 Remember that gofix will handle the bulk of the rewrites 494 necessary for these changes to package APIs. 495 </p> 496 497 <h3 id="r57.cmd">Tools</h3> 498 499 <p><a href="/cmd/gofix/">Gofix</a>, a new command, is described above.</p> 500 501 <p> 502 <a href="/cmd/gotest/">Gotest</a> is now a Go program instead of a shell script. 503 The new <code>-test.short</code> flag in combination with package testing's Short function 504 allows you to write tests that can be run in normal or “short” mode; 505 all.bash runs tests in short mode to reduce installation time. 506 The Makefiles know about the flag: use <code>make testshort</code>. 507 </p> 508 509 <p> 510 The run-time support now implements CPU and memory profiling. 511 Gotest's new 512 <a href="/cmd/gotest/"><code>-test.cpuprofile</code> and 513 <code>-test.memprofile</code> flags</a> make it easy to 514 profile tests. 515 To add profiling to your web server, see the <a href="/pkg/http/pprof/">http/pprof</a> 516 documentation. 517 For other uses, see the <a href="/pkg/runtime/pprof/">runtime/pprof</a> documentation. 518 </p> 519 520 <h3 id="r57.minor">Minor revisions</h3> 521 522 <p>r57.1 fixes a <a href="http://code.google.com/p/go/source/detail?r=ff2bc62726e7145eb2ecc1e0f076998e4a8f86f0">nil pointer dereference in http.FormFile</a>.</p> 523 <p>r57.2 fixes a <a href="http://code.google.com/p/go/source/detail?r=063b0ff67d8277df03c956208abc068076818dae">use of uninitialized memory in programs that misuse <code>goto</code></a>.</p> 524 525 <h2 id="r56">r56 (released 2011/03/16)</h2> 526 527 <p> 528 The r56 release was the first stable release and corresponds to 529 <code><a href="weekly.html#2011-03-07">weekly.2011-03-07.1</a></code>. 530 The numbering starts at 56 because before this release, 531 what we now consider weekly snapshots were called releases. 532 </p>