Skip to content

Commit 90b39f3

Browse files
committed
doc: add type aliases to go1.9.html
Updates #20587 Change-Id: I5df603505ae1d4b65687bec1e973a4ab318b34f1 Reviewed-on: https://go-review.googlesource.com/45014 Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-by: Rob Pike <r@golang.org>
1 parent 4e7067c commit 90b39f3

File tree

1 file changed

+36
-7
lines changed

1 file changed

+36
-7
lines changed

doc/go1.9.html

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,18 @@ <h2 id="introduction">DRAFT RELEASE NOTES - Introduction to Go 1.9</h2>
2323
</strong></p>
2424

2525
<p>
26-
The latest Go release, version 1.9, arrives six months after <a href="go1.8">Go 1.8</a>
27-
and is the tenth release in the <a href="https://golang.org/doc/devel/release.html">Go 1.x series</a>.
28-
Most of its changes are in the implementation of the toolchain, runtime, and libraries.
29-
There are no changes to the language specification.
30-
As always, the release maintains the Go 1 <a href="/doc/go1compat.html">promise of compatibility</a>.
31-
We expect almost all Go programs to continue to compile and run as before.
26+
The latest Go release, version 1.9, arrives six months
27+
after <a href="go1.8">Go 1.8</a> and is the tenth release in
28+
the <a href="https://golang.org/doc/devel/release.html">Go 1.x
29+
series</a>.
30+
There is one <a href="#language">change to the language</a>, adding
31+
support for type aliases.
32+
Most of the changes are in the implementation of the toolchain,
33+
runtime, and libraries.
34+
As always, the release maintains the Go 1
35+
<a href="/doc/go1compat.html">promise of compatibility</a>.
36+
We expect almost all Go programs to continue to compile and run as
37+
before.
3238
</p>
3339

3440
<p>
@@ -39,6 +45,29 @@ <h2 id="introduction">DRAFT RELEASE NOTES - Introduction to Go 1.9</h2>
3945
and includes a new <a href="#math-bits">bit manipulation package</a>.
4046
</p>
4147

48+
<h2 id="language">Changes to the language</h2>
49+
50+
<p>
51+
There is one change to the language.
52+
Go now supports type aliases to support gradual code repair while
53+
moving a type between packages.
54+
The <a href="https://golang.org/design/18130-type-alias">type alias
55+
design document</a>
56+
and <a href="https://talks.golang.org/2016/refactor.article">an
57+
article on refactoring</a> cover the problem in detail.
58+
In short, a type alias declaration has the form:
59+
</p>
60+
61+
<pre>
62+
type T1 = T2
63+
</pre>
64+
65+
<p>
66+
This declaration introduces an alias name <code>T1</code>—an
67+
alternate spelling—for the type denoted by <code>T2</code>; that is,
68+
both <code>T1</code> and <code>T2</code> denote the same type.
69+
</p>
70+
4271
<h2 id="ports">Ports</h2>
4372

4473
<p>
@@ -147,7 +176,7 @@ <h3 id="test-helper">Test Helper Functions</h3>
147176
The
148177
new <a href="/pkg/testing/#T.Helper"><code>(*T).Helper</code></a>
149178
an <a href="/pkg/testing/#B.Helper"><code>(*B).Helper</code></a>
150-
methods marks the calling function as a test helper function. When
179+
methods mark the calling function as a test helper function. When
151180
printing file and line information, that function will be skipped.
152181
This permits writing test helper functions while still having useful
153182
line numbers for users.

0 commit comments

Comments
 (0)