blob: ae9ea28340189143660607839b0bb7350ff98ec0 [file] [log] [blame]
Rob Pikebab4dec2011-12-07 14:33:37 -08001<!-- Go 1 Release Notes -->
Rob Pike9d59c402011-12-08 11:35:28 -08002<!--
3 DO NOT EDIT: created by
4 tmpltohtml go1.tmpl
5-->
6
Rob Pikebab4dec2011-12-07 14:33:37 -08007
8<h2 id="introduction">Introduction to Go 1</h2>
9
10<p>
11For a full explanation of the motivation and design of Go 1, see XXX.
12Here follows a summary.
13</p>
14
15<p>
Rob Pike2fa987b2011-12-07 16:11:17 -080016Go 1 is intended to be a stable language and core library set that
17will form a reliable foundation for people and organizations that
18want to make a long-term commitment to developing in the Go programming
19language. Go will continue to develop, but in a way that guarantees
20code written to the Go 1 specification will continue to work. For
21instance, Go 1 will be a supported platform on Google App Engine
22for the next few years. Incompatible changes to the environment,
23should they arise, will be done in a distinct version.
Rob Pikebab4dec2011-12-07 14:33:37 -080024</p>
25
26<p>
Rob Pike2fa987b2011-12-07 16:11:17 -080027This document describes the changes in the language and libraries
28in Go 1, relative to the previous release, r60 (at the time of
29writing, tagged as r60.3). It also explains how to update code at
30r60 to compile and run under Go 1. Finally, it outlines the new
31<code>go</code> command for building Go programs and the new binary
32release process being introduced. Most of these topics have more
33thorough presentations elsewhere; such documents are linked below.
Rob Pike136c04f2011-12-08 16:39:05 -080034</p>
Rob Pikebab4dec2011-12-07 14:33:37 -080035
36<h2 id="language">Changes to the language</h2>
37
38<h3 id="append">Append</h3>
39
Rob Pike136c04f2011-12-08 16:39:05 -080040<p>
41The <code>append</code> built-in function is variadic, so one can
42append to a byte slice using the <code>...</code> syntax in the
43call.
44</p>
45
46<pre><!--{{code "progs/go1.go" `/greeting := ..byte/` `/append.*hello/`}}
47--> greeting := []byte{}
48 greeting = append(greeting, []byte(&#34;hello &#34;)...)
49</pre>
50
51<p>
52By analogy with the similar property of <code>copy</code>, Go 1
53permits a string to be appended (byte-wise) directly to a byte
54slice; the conversion is no longer necessary:
55</p>
56
57<pre><!--{{code "progs/go1.go" `/append.*world/`}}
58--> greeting = append(greeting, &#34;world&#34;...)
59</pre>
60
61<p>
62<em>Updating</em>:
63This is a new feature, so existing code needs no changes.
64</p>
65
Rob Pikebab4dec2011-12-07 14:33:37 -080066<h3 id="close">Close</h3>
67
Rob Pike136c04f2011-12-08 16:39:05 -080068<p>
69The <code>close</code> built-in function lets a sender tell a receiver
70that no more data will be transmitted on the channel. In Go 1 the
71type system enforces the directionality when possible: it is illegal
72to call <code>close</code> on a receive-only channel:
73</p>
74
75<pre>
76 var c chan int
77 var csend chan<- int = c
78 var crecv <-chan int = c
79 close(c) // legal
80 close(csend) // legal
81 close(crecv) // illegal
82</pre>
83
84<p>
85<em>Updating</em>:
86Existing code that attempts to close a receive-only channel was
87erroneous even before Go 1 and should be fixed. The compiler will
88now reject such code.
89</p>
90
Rob Pike9d59c402011-12-08 11:35:28 -080091<h3 id="literals">Composite literals</h3>
Rob Pikebab4dec2011-12-07 14:33:37 -080092
Rob Pike2e338fa2011-12-09 08:31:57 -080093<p>
94In Go 1, a composite literal of array, slice, or map type can elide the
95type specification for the elements' initializers if they are of pointer type.
96All four of the initializations in this example are legal; the last one was illegal before Go 1.
97</p>
98
99<pre><!--{{code "progs/go1.go" `/type Date struct/` `/STOP/`}}
100--> type Date struct {
101 month string
102 day int
103 }
104 // Struct values, fully qualified; always legal.
105 holiday1 := []Date{
106 Date{&#34;Feb&#34;, 14},
107 Date{&#34;Nov&#34;, 11},
108 Date{&#34;Dec&#34;, 25},
109 }
110 // Struct values, type name elided; always legal.
111 holiday2 := []Date{
112 {&#34;Feb&#34;, 14},
113 {&#34;Nov&#34;, 11},
114 {&#34;Dec&#34;, 25},
115 }
116 // Pointers, fully qualified, always legal.
117 holiday3 := []*Date{
118 &amp;Date{&#34;Feb&#34;, 14},
119 &amp;Date{&#34;Nov&#34;, 11},
120 &amp;Date{&#34;Dec&#34;, 25},
121 }
122 // Pointers, type name elided; legal in Go 1.
123 holiday4 := []*Date{
124 {&#34;Feb&#34;, 14},
125 {&#34;Nov&#34;, 11},
126 {&#34;Dec&#34;, 25},
127 }
128</pre>
129
130<p>
131<em>Updating</em>:
132This change has no effect on existing code, but the command
133<code>gofmt</code> <code>-s</code> applied to existing source
134will, among other things, elide explicit element types wherever permitted.
135</p>
136
137
Rob Pike9d59c402011-12-08 11:35:28 -0800138<h3 id="init">Goroutines during init</h3>
Rob Pikebab4dec2011-12-07 14:33:37 -0800139
Rob Pike136c04f2011-12-08 16:39:05 -0800140<p>
141Go 1 allows goroutines to be created and run during initialization.
142(They used to be created but were not run until after initialization
143completed.) Code that uses goroutines can now be called from
144<code>init</code> routines and global initialization expressions
145without introducing a deadlock.
146</p>
147
148<pre><!--{{code "progs/go1.go" `/PackageGlobal/` `/^}/`}}
149-->var PackageGlobal int
150
151func init() {
152 c := make(chan int)
153 go initializationFunction(c)
154 PackageGlobal = &lt;-c
155}
156</pre>
157
158<p>
159<em>Updating</em>:
160This is a new feature, so existing code needs no changes,
161although it's possible that code that depends on goroutines not starting before <code>main</code> will break.
162There was no such code in the standard repository.
163</p>
164
Rob Pikebab4dec2011-12-07 14:33:37 -0800165<h3 id="rune">The rune type</h3>
166
Rob Pike2e338fa2011-12-09 08:31:57 -0800167<p>
168Go 1 introduces a new basic type, <code>rune</code>, to be used to represent
169individual Unicode code points.
170It is an alias for <code>int32</code>, analogous to <code>byte</code>
171as an alias for <code>uint8</code>.
172</p>
173
174<p>
175Character literals such as <code>'a'</code>, <code>'語'</code>, and <code>'\u0345'</code>
176now have default type <code>rune</code>,
177analogous to <code>1.0</code> having default type <code>float64</code>.
178A variable initialized to a character constant will therefore
179have type <code>rune</code> unless otherwise specified.
180</p>
181
182<p>
183Libraries have been updated to use <code>rune</code> rather than <code>int</code>
184when appropriate. For instance, the functions <code>unicode.ToLower</code> and
185relatives now take and return a <code>rune</code>.
186</p>
187
188<pre><!--{{code "progs/go1.go" `/STARTRUNE/` `/ENDRUNE/`}}
189--> delta := &#39;δ&#39; // delta has type rune.
190 var DELTA rune
191 DELTA = unicode.ToUpper(delta)
192 epsilon := unicode.ToLower(DELTA + 1)
193 if epsilon != &#39;δ&#39;+1 {
194 log.Fatal(&#34;inconsistent casing for Greek&#34;)
195 }
196</pre>
197
198<p>
199<em>Updating</em>:
200Most source code will be unaffected by this because the type inference from
201<code>:=</code> initializers introduces the new type silently, and it propagates
202from there.
203Some code may get type errors that a trivial conversion will resolve.
204</p>
205
206<h3 id="error">The error type</h3>
207
208<p>
209Go 1 introduces a new built-in type, <code>error</code>, which has the following definition:
210</p>
211
212<pre>
213 type error interface {
214 Error() string
215 }
216</pre>
217
218<p>
219Since the consequences of this type are all in the package library,
220it is discussed <a href="errors">below</a>.
221</p>
222
Rob Pike9d59c402011-12-08 11:35:28 -0800223<h3 id="delete">Deleting from maps</h3>
Rob Pike2fa987b2011-12-07 16:11:17 -0800224
225<p>
226The original syntax for deleting an element in a map was:
227</p>
228
229<pre>
Rob Pike2e338fa2011-12-09 08:31:57 -0800230 m[k] = ignored, false
Rob Pike2fa987b2011-12-07 16:11:17 -0800231</pre>
232
233<p>
Rob Pike9d59c402011-12-08 11:35:28 -0800234In Go 1, that syntax has gone; instead there is a new built-in
Rob Pike2fa987b2011-12-07 16:11:17 -0800235function, <code>delete</code>. The call
236</p>
237
238<pre><!--{{code "progs/go1.go" `/delete\(m, k\)/`}}
239--> delete(m, k)
240</pre>
241
242<p>
243will delete the map entry retrieved by the expression <code>m[k]</code>.
244There is no return value. Deleting a non-existent entry is a no-op.
245</p>
246
247<p>
248<em>Updating</em>:
249Gofix will convert expressions of the form <code>m[k] = ignored,
250false</code> into <code>delete(m, k)</code> when it is clear that
251the ignored value can be safely discarded from the program and
252<code>false</code> refers to the predefined boolean constant. Gofix
253will flag other uses of the syntax for inspection by the programmer.
254</p>
255
Rob Pike136c04f2011-12-08 16:39:05 -0800256<h3 id="iteration">Iterating in maps</h3>
257
258<p>
259In Go 1, the order in which elements are visited when iterating
260over a map using a <code>for</code> <code>range</code> statement
261is defined to be unpredictable, even if the same loop is run multiple
262times with the same map.
263Code should not assume that the elements are visited in any particular order.
264</p>
265
266<pre><!--{{code "progs/go1.go" `/Sunday/` `/^ }/`}}
267--> m := map[string]int{&#34;Sunday&#34;: 0, &#34;Monday&#34;: 1}
268 for name, value := range m {
269 // This loop should not assume Sunday will be visited first.
270 f(name, value)
271 }
272</pre>
273
274<p>
275<em>Updating</em>:
276This is one change where tools cannot help. Most existing code
277will be unaffected, but some programs may break or misbehave; we
278recommend manual checking of all range statements over maps to
279verify they do not depend on iteration order. There were a few such
280examples in the standard repository; they have been fixed.
281Note that it was already incorrect to depend on the iteration order, which
282was unspecified. This change codifies the unpredictability.
283</p>
Rob Pikebab4dec2011-12-07 14:33:37 -0800284
285<h3 id="multiple_assignment">Multiple assignment</h3>
286
Rob Pike136c04f2011-12-08 16:39:05 -0800287<p>
288Go 1 fully specifies the evaluation order in multiple assignment
289statements. In particular, if the left-hand side of the assignment
290statement contains expressions that require evaluation, such as
291function calls or array indexing operations, these will all be done
292using the usual left-to-right rule before any variables are assigned
293their value. Once everything is evaluated, the actual assignments
294proceed in left-to-right order.
295</p>
296
297<p>
298These examples illustrate the behavior.
299</p>
300
301<pre><!--{{code "progs/go1.go" `/sa :=/` `/then sc.0. = 2/`}}
302--> sa := []int{1, 2, 3}
303 i := 0
304 i, sa[i] = 1, 2 // sets i = 1, sa[0] = 2
305
306 sb := []int{1, 2, 3}
307 j := 0
308 sb[j], j = 2, 1 // sets sb[0] = 2, j = 1
309
310 sc := []int{1, 2, 3}
311 sc[0], sc[0] = 1, 2 // sets sc[0] = 1, then sc[0] = 2 (so sc[0] = 2 at end)
312</pre>
313
Rob Pike2e338fa2011-12-09 08:31:57 -0800314<p>
Rob Pike136c04f2011-12-08 16:39:05 -0800315<em>Updating</em>:
316This is one change where tools cannot help, but breakage is unlikely.
317No code in the standard repository was broken by this change, and code
318that depended on the previous unspecified behavior was already incorrect.
319</p>
320
Rob Pikebab4dec2011-12-07 14:33:37 -0800321<h3 id="shadowing">Returns and shadowed variables</h3>
322
Rob Pike136c04f2011-12-08 16:39:05 -0800323<p>
324A shadowed variable is one that has the same name as another variable in an inner scope.
325In functions with named return values,
326the Go 1 compilers disallow return statements without arguments if any of the named return values is shadowed at the point of the return statement.
327(It isn't part of the specification, because this is one area we are still exploring;
328the situation is analogous to the compilers rejecting functions that do not end with an explicit return statement.)
329</p>
330
331<p>
332This function implicitly returns a shadowed return value and will be rejected by the compiler:
333</p>
334
335<pre>
336 func Bug() (i, j, k int) {
337 for i = 0; i < 5; i++ {
338 for j := 0; j < 5; j++ { // Redeclares j.
339 k += i*j
340 if k > 100 {
341 return // Rejected: j is shadowed here.
342 }
343 }
344 }
345 return // OK: j is not shadowed here.
346 }
347</pre>
348
349<p>
350<em>Updating</em>:
351Code that shadows return values in this way will be rejected by the compiler and will need to be fixed by hand.
352The few cases that arose in the standard repository were mostly bugs.
353</p>
354
355<h3 id="unexported">Copying structs with unexported fields</h3>
356
Rob Pike2e338fa2011-12-09 08:31:57 -0800357<p>
358Go 1 relaxes the rules about accessing structs with unexported (lower-case) fields,
359permitting a client package to assign (and therefore copy) such a struct.
360Of course, the client package still cannot access such fields individually.
361</p>
362
363<p>
364As an example, if package <code>p</code> includes the definitions,
365</p>
366
367<pre>
368 type Struct struct {
369 Public int
370 secret int
371 }
372 func NewStruct(a int) Struct { // Note: not a pointer.
373 return Struct{a, f(a)}
374 }
375 func (s Struct) String() string {
376 return fmt.Sprintf("{%d (secret %d)}", s.Public, s.secret)
377 }
378</pre>
379
380<p>
381a package that imports <code>p</code> can assign and copy values of type
382<code>p.Struct</code> at will.
383Behind the scenes the unexported fields will be assigned and copied just
384as if they were exported,
385but the client code will never be aware of them. The code
386</p>
387
388<pre>
389 import "p"
390
391 myStruct := p.NewStruct(23)
392 copyOfMyStruct := myStruct
393 fmt.Println(myStruct, copyOfMyStruct)
394</pre>
395
396<p>
397will show that the secret field of the struct has been copied to the new value.
398</p>
399
400<p>
401<em>Updating</em>:
402This is a new feature, so existing code needs no changes.
403</p>
404
Rob Pike9d59c402011-12-08 11:35:28 -0800405<h3 id="equality">Equality of structs and arrays</h3>
Rob Pikebab4dec2011-12-07 14:33:37 -0800406
Rob Pike136c04f2011-12-08 16:39:05 -0800407<p>
408Go 1 defines equality and inequality (<code>==</code> and
409<code>!=</code>) for struct and array values, respectively, provided
410the elements of the data structures can themselves be compared.
411That is, if equality is defined for all the fields of a struct (or
412an array element), then it is defined for the struct (or array).
413</p>
414
415<p>
416As a result, structs and arrays can now be used as map keys:
417</p>
418
419<pre><!--{{code "progs/go1.go" `/type Day struct/` `/Printf/`}}
420--> // type Day struct {
421 // long string
422 // short string
423 // }
424 // Christmas := Day{&#34;Christmas&#34;, &#34;XMas&#34;}
425 // Thanksgiving := Day{&#34;Thanksgiving&#34;, &#34;Turkey&#34;}
426 // holiday := map[Day]bool {
427 // Christmas: true,
428 // Thanksgiving: true,
429 // }
430 // fmt.Printf(&#34;Christmas is a holiday: %t\n&#34;, holiday[Christmas])
431</pre>
432
433<p>
434Note that equality is still undefined for slices, for which the
435calculation is in general infeasible. Also note that the ordered
436comparison operators (<code>&lt;</code> <code>&lt;=</code>
437<code>&gt;</code> <code>&gt;=</code>) are still undefined for
438structs and arrays.
439
440<p>
441<em>Updating</em>:
442This is a new feature, so existing code needs no changes.
443</p>
444
445<h3 id="funcs">Function and map equality</h3>
446
447<p>
448Go 1 disallows checking for equality of functions and maps,
449respectively, except to compare them directly to <code>nil</code>.
450</p>
451
452<p>
453<em>Updating</em>:
454Existing code that depends on function or map equality will be
455rejected by the compiler and will need to be fixed by hand.
456Few programs will be affected, but the fix may require some
457redesign.
458</p>
459
Rob Pikebab4dec2011-12-07 14:33:37 -0800460<h2 id="library">Changes to the library</h2>
461
Rob Pike9d59c402011-12-08 11:35:28 -0800462<h3 id="hierarchy">The package hierarchy</h3>
463
464<p>
465Go 1 has a rearranged package hierarchy that groups related items
466into subdirectories. For instance, <code>utf8</code> and
467<code>utf16</code> now occupy subdirectories of <code>unicode</code>.
468Also, <a href="#subrepo">some packages</a> have moved into
469subrepositories of
470<a href="http://code.google.com/p/go"><code>code.google.com/p/go</code></a>
471while <a href="#deleted">others</a> have been deleted outright.
472</p>
473
474<table class="codetable" frame="border" summary="Moved packages">
475<colgroup align="left" width="60%"></colgroup>
476<colgroup align="left" width="40%"></colgroup>
477<tr>
478<th align="left">Old path</th>
479<th align="left">New path</th>
480</tr>
Rob Pike71ccf732011-12-09 14:12:51 -0800481<tr>
482<td colspan="2"><hr></td>
483</tr>
Rob Pike136c04f2011-12-08 16:39:05 -0800484<tr><td>asn1</td> <td>encoding/asn1</td></tr>
Rob Pike9d59c402011-12-08 11:35:28 -0800485<tr><td>csv</td> <td>encoding/csv</td></tr>
486<tr><td>gob</td> <td>encoding/gob</td></tr>
487<tr><td>json</td> <td>encoding/json</td></tr>
488<tr><td>xml</td> <td>encoding/xml</td></tr>
489<tr>
490<td colspan="2"><hr></td>
491</tr>
492<tr><td>exp/template/html</td> <td>html/template</td></tr>
493<tr>
494<td colspan="2"><hr></td>
495</tr>
496<tr><td>big</td> <td>math/big</td></tr>
497<tr><td>cmath</td> <td>math/cmplx</td></tr>
498<tr><td>rand</td> <td>math/rand</td></tr>
499<tr>
500<td colspan="2"><hr></td>
501</tr>
502<tr><td>http</td> <td>net/http</td></tr>
503<tr><td>http/cgi</td> <td>net/http/cgi</td></tr>
504<tr><td>http/fcgi</td> <td>net/http/fcgi</td></tr>
505<tr><td>http/httptest</td> <td>net/http/httptest</td></tr>
506<tr><td>http/pprof</td> <td>net/http/pprof</td></tr>
507<tr><td>mail</td> <td>net/mail</td></tr>
508<tr><td>rpc</td> <td>net/rpc</td></tr>
509<tr><td>rpc/jsonrpc</td> <td>net/rpc/jsonrpc</td></tr>
510<tr><td>smtp</td> <td>net/smtp</td></tr>
511<tr><td>url</td> <td>net/url</td></tr>
512<tr>
513<td colspan="2"><hr></td>
514</tr>
515<tr><td>exec</td> <td>os/exec</td></tr>
516<tr>
517<td colspan="2"><hr></td>
518</tr>
519<tr><td>scanner</td> <td>text/scanner</td></tr>
520<tr><td>tabwriter</td> <td>text/tabwriter</td></tr>
521<tr><td>template</td> <td>text/template</td></tr>
522<tr><td>template/parse</td> <td>text/template/parse</td></tr>
523<tr>
524<td colspan="2"><hr></td>
525</tr>
526<tr><td>utf8</td> <td>unicode/utf8</td></tr>
527<tr><td>utf16</td> <td>unicode/utf16</td></tr>
528</table>
529
530<p>
531Note that the package names for the old <code>cmath</code> and
532<code>exp/template/html</code> packages have changed to <code>cmplx</code>
533and <code>template</code>.
534</p>
535
536<p>
537<em>Updating</em>:
538Gofix will update all imports and package renames for packages that
539remain inside the standard repository. Programs that import packages
540that are no longer in the standard repository will need to be edited
541by hand.
Rob Pike71ccf732011-12-09 14:12:51 -0800542<br>
543<font color="red">TODO: gofix should warn about deletions.</font>
544<br>
545<font color="red">TODO: gofix should also handle packages that move to subrepos.</font>
Rob Pike9d59c402011-12-08 11:35:28 -0800546</p>
Rob Pikebab4dec2011-12-07 14:33:37 -0800547
Rob Pike71ccf732011-12-09 14:12:51 -0800548<h3 id="errors">The error type and errors package</h3>
Rob Pikebab4dec2011-12-07 14:33:37 -0800549
Rob Pike9d59c402011-12-08 11:35:28 -0800550<h3 id="errno">System call errors</h3>
Rob Pikebab4dec2011-12-07 14:33:37 -0800551
Rob Pike71ccf732011-12-09 14:12:51 -0800552<p>
553In Go 1, the
554<a href="http://golang.org/pkg/syscall"><code>syscall</code></a>
555package returns an <code>error</code> for system call errors,
556rather than plain integer <code>errno</code> values.
557On Unix, the implementation is done by a
558<a href="http://golang.org/pkg/syscall/#Errno"><code>syscall.Errno</code></a> type
559that satisfies <code>error</code> and replaces the old <code>os.Errno</code>.
560</p>
561
562<p>
563<em>Updating</em>:
564Gofix will update almost all code affected by the change.
565Regardless, most code should use the <code>os</code> package
566rather than <code>syscall</code> and so will be unaffected.
567</p>
568
Rob Pikebab4dec2011-12-07 14:33:37 -0800569<h3 id="time">Time</h3>
570
571<h3 id="html">The html package</h3>
572
573<h3 id="http">The http package</h3>
574
575<h3 id="strconv">The strconv package</h3>
576
Rob Pike71ccf732011-12-09 14:12:51 -0800577<p>
578In Go 1, the
579<a href="http://golang.org/pkg/syscall"><code>strconv</code></a>
580package has been significantly reworked to make it more Go-like and less C-like,
581although <code>Atoi</code> lives on (it's similar to
582<code>int(ParseInt(x, 10, 0))</code>, as does
583<code>Itoa(x)</code> (<code>FormatInt(int64(x), 10)</code>).
584There are also new variants of some of the functions that append to byte slices rather than
585return strings, to allow control over allocation.
586</p>
587
588<p>
589This table summarizes the renamings; see the
590<a href="/pkg/strconv">package documentation</a>
591for full details.
592</p>
593
594<table class="codetable" frame="border" summary="strconv renames">
595<colgroup align="left" width="50%"></colgroup>
596<colgroup align="left" width="50%"></colgroup>
597<tr>
598<th align="left">Old call</th>
599<th align="left">New call</th>
600</tr>
601<tr>
602<td colspan="2"><hr></td>
603</tr>
604<tr><td>Atob(x)</td> <td>ParseBool(x)</td></tr>
605<tr>
606<td colspan="2"><hr></td>
607</tr>
608<tr><td>Atof32(x)</td> <td>ParseFloat(x, 32)§</td></tr>
609<tr><td>Atof64(x)</td> <td>ParseFloat(x, 64)</td></tr>
610<tr><td>AtofN(x, n)</td> <td>ParseFloat(x, n)</td></tr>
611<tr>
612<td colspan="2"><hr></td>
613</tr>
614<tr><td>Atoi(x)</td> <td>Atoi(x)</td></tr>
615<tr><td>Atoi(x)</td> <td>ParseInt(x, 10, 0)§</td></tr>
616<tr><td>Atoi64(x)</td> <td>ParseInt(x, 10, 64)</td></tr>
617<tr>
618<td colspan="2"><hr></td>
619</tr>
620<tr><td>Atoui(x)</td> <td>ParseUint(x, 10, 0)§</td></tr>
621<tr><td>Atoi64(x)</td> <td>ParseInt(x, 10, 64)</td></tr>
622<tr>
623<td colspan="2"><hr></td>
624</tr>
625<tr><td>Btoi64(x, b)</td> <td>ParseInt(x, b, 64)</td></tr>
626<tr><td>Btoui64(x, b)</td> <td>ParseUint(x, b, 64)</td></tr>
627<tr>
628<td colspan="2"><hr></td>
629</tr>
630<tr><td>Btoa(x)</td> <td>FormatBool(x)</td></tr>
631<tr>
632<td colspan="2"><hr></td>
633</tr>
634<tr><td>Ftoa32(x, f, p)</td> <td>FormatFloat(x, float64(f), p, 32)</td></tr>
635<tr><td>Ftoa64(x, f, p)</td> <td>FormatFloat(x, f, p, 64)</td></tr>
636<tr><td>FtoaN(x, f, p, n)</td> <td>FormatFloat(x, f, p, n)</td></tr>
637<tr>
638<td colspan="2"><hr></td>
639</tr>
640<tr><td>Itoa(x)</td> <td>Itoa(x)</td></tr>
641<tr><td>Itoa(x)</td> <td>FormatInt(int64(x), 10)</td></tr>
642<tr><td>Itoa64(x)</td> <td>FormatInt(x, 10)</td></tr>
643<tr>
644<td colspan="2"><hr></td>
645</tr>
646<tr><td>Itob(x, b)</td> <td>FormatInt(int64(x), b)</td></tr>
647<tr><td>Itob64(x, b)</td> <td>FormatInt(x, b)</td></tr>
648<tr>
649<td colspan="2"><hr></td>
650</tr>
651<tr><td>Uitoa(x)</td> <td>FormatUint(uint64(x), 10)</td></tr>
652<tr><td>Uitoa64(x)</td> <td>FormatUint(x, 10)</td></tr>
653<tr>
654<td colspan="2"><hr></td>
655</tr>
656<tr><td>Uitob(x, b)</td> <td>FormatUint(uint64(x), b)</td></tr>
657<tr><td>Uitob64(x, b)</td> <td>FormatUint(x, b)</td></tr>
658</table>
659
660<p>
661<em>Updating</em>:
662Gofix will update almost all code affected by the change.
663<br>
664§ <code>Atoi</code> persists but <code>Atoui</code> and <code>Atof32</code> do not, so
665they may require
666a cast that must be added by hand; gofix will warn about it.
667</p>
668
Rob Pikebab4dec2011-12-07 14:33:37 -0800669<h3 id="exp">The package tree exp</h3>
670
671<h3 id="old">The package tree old</h3>
672
Rob Pike9d59c402011-12-08 11:35:28 -0800673<h3 id="deleted">Deleted packages</h3>
Rob Pikebab4dec2011-12-07 14:33:37 -0800674
675<!--
Rob Pike9d59c402011-12-08 11:35:28 -0800676
677moving to exp/* (and thus not in Go 1):
678 ebnf, command ebnflint
679 go/types, command gotype
680 http/spdy
681
682deleted:
683 container/vector
684 exp/datafmt
685 go/typechecker
686 try, command gotry
687
Rob Pikebab4dec2011-12-07 14:33:37 -0800688go/typechecker
689go/types
690ebnf (and cmd/ebnflint)
691container/vector
692try (and gotry)
693exp/datafmt
694netchan
695-->
696
Rob Pike9d59c402011-12-08 11:35:28 -0800697<h3 id="subrepo">Packages moving to subrepositories</h3>
Rob Pikebab4dec2011-12-07 14:33:37 -0800698
699<!--
700crypto/openpgp to XXX
701maybe exp/ssh?
702-->
703
704<h3 id="os_fileinfo">The os.FileInfo type</h3>
705
706<h2 id="go_command">The go command</h2>
707
708<h2 id="releases">Packaged releases</h2>
709