14
14
hg update release.r<i>NN</i>
17
<h2 id="r59">r59 (released 2011/08/01)</h2>
20
The r59 release corresponds to
21
<code><a href="weekly.html#2011-07-07">weekly.2011-07-07</a></code>.
22
This section highlights the most significant changes in this release.
23
For a more detailed summary, see the
24
<a href="weekly.html#2011-07-07">weekly release notes</a>.
25
For complete information, see the
26
<a href="http://code.google.com/p/go/source/list?r=release-branch.r59">Mercurial change list</a>.
29
<h3 id="r59.lang">Language</h3>
32
This release includes a language change that restricts the use of
33
<code>goto</code>. In essence, a <code>goto</code> statement outside a block
34
cannot jump to a label inside that block. Your code may require changes if it
35
uses <code>goto</code>.
36
See <a href="http://code.google.com/p/go/source/detail?r=dc6d3cf9279d">this
37
changeset</a> for how the new rule affected the Go tree.
40
<h3 id="r59.pkg">Packages</h3>
43
As usual, <a href="/cmd/gofix/">gofix</a> will handle the bulk of the rewrites
44
necessary for these changes to package APIs.
48
<a href="/pkg/http">Package http</a> has a new
49
<a href="/pkg/http/#FileSystem">FileSystem</a> interface that provides access
50
to files. The <a href="/pkg/http/#FileServer">FileServer</a> helper now takes a
51
<code>FileSystem</code> argument instead of an explicit file system root. By
52
implementing your own <code>FileSystem</code> you can use the
53
<code>FileServer</code> to serve arbitrary data.
57
<a href="/pkg/os/">Package os</a>'s <code>ErrorString</code> type has been
58
hidden. Most uses of <code>os.ErrorString</code> can be replaced with
59
<a href="/pkg/os/#NewError">os.NewError</a>.
63
<a href="/pkg/reflect/">Package reflect</a> supports a new struct tag scheme
64
that enables sharing of struct tags between multiple packages.
65
In this scheme, the tags must be of the form:
68
`key:"value" key2:"value2"`
71
The <a href="/pkg/reflect/#StructField">StructField</a> type's Tag field now
72
has type <a href="/pkg/reflect/#StructTag">StructTag</a>, which has a
73
<code>Get</code> method. Clients of <a href="/pkg/json">json</a> and
74
<a href="/pkg/xml">xml</a> will need to be updated. Code that says
86
X int `json:"name"` // or `xml:"name"`
90
Use <a href="/cmd/govet/">govet</a> to identify struct tags that need to be
91
changed to use the new syntax.
95
<a href="/pkg/sort/">Package sort</a>'s <code>IntArray</code> type has been
96
renamed to <a href="/pkg/sort/#IntSlice">IntSlice</a>, and similarly for
97
<a href="/pkg/sort/#Float64Slice">Float64Slice</a> and
98
<a href="/pkg/sort/#StringSlice">StringSlice</a>.
102
<a href="/pkg/strings/">Package strings</a>'s <code>Split</code> function has
103
itself been split into <a href="/pkg/strings/#Split">Split</a> and
104
<a href="/pkg/strings/#SplitN">SplitN</a>.
105
<code>SplitN</code> is the same as the old <code>Split</code>.
106
The new <code>Split</code> is equivalent to <code>SplitN</code> with a final
110
<a href="/pkg/image/draw/">Package image/draw</a>'s
111
<a href="/pkg/image/draw/#Draw">Draw</a> function now takes an additional
112
argument, a compositing operator.
113
If in doubt, use <a href="/pkg/image/draw/#Op">draw.Over</a>.
116
<h3 id="r59.cmd">Tools</h3>
119
<a href="/cmd/goinstall/">Goinstall</a> now installs packages and commands from
120
arbitrary remote repositories (not just Google Code, Github, and so on).
121
See the <a href="/cmd/goinstall/">goinstall documentation</a> for details.
17
124
<h2 id="r58">r58 (released 2011/06/29)</h2>