summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-06-14 13:23:46 +0200
committerOndřej Surý <ondrej@sury.org>2012-06-14 13:23:46 +0200
commit917c5fb8ec48e22459d77e3849e6d388f93d3260 (patch)
tree9c23734a6ffd4d2a8ac99502eda3cc812a8b130b /doc
parent0003ee229fd33ff46cb5f2fe1e35f5c0284debc4 (diff)
downloadgolang-917c5fb8ec48e22459d77e3849e6d388f93d3260.tar.gz
Imported Upstream version 1.0.2upstream/1.0.2
Diffstat (limited to 'doc')
-rw-r--r--doc/devel/release.html8
-rw-r--r--doc/go_spec.html64
-rw-r--r--doc/install-source.html1
-rw-r--r--doc/install.html26
-rw-r--r--doc/style.css1
-rw-r--r--doc/talks/go_talk-20091030.pdfbin0 -> 247502 bytes
6 files changed, 79 insertions, 21 deletions
diff --git a/doc/devel/release.html b/doc/devel/release.html
index dda8239a6..986310610 100644
--- a/doc/devel/release.html
+++ b/doc/devel/release.html
@@ -46,6 +46,14 @@ It also includes several minor code and documentation fixes.
</p>
<p>
+go1.0.2 (released 2012/06/13) was issued to fix two bugs in the implementation
+of maps using struct or array keys:
+<a href="http://code.google.com/p/go/issues/detail?id=3695">issue 3695</a> and
+<a href="http://code.google.com/p/go/issues/detail?id=3573">issue 3573</a>.
+It also includes many minor code and documentation fixes.
+</p>
+
+<p>
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.
</p>
diff --git a/doc/go_spec.html b/doc/go_spec.html
index 8cb257a59..90acc1704 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -1,6 +1,6 @@
<!--{
"Title": "The Go Programming Language Specification",
- "Subtitle": "Version of March 17, 2012",
+ "Subtitle": "Version of June 4, 2012",
"Path": "/ref/spec"
}-->
@@ -684,6 +684,8 @@ consists of all methods with receiver type <code>T</code>.
The method set of the corresponding pointer type <code>*T</code>
is the set of all methods with receiver <code>*T</code> or <code>T</code>
(that is, it also contains the method set of <code>T</code>).
+Further rules apply to structs containing anonymous fields, as described
+in the section on <a href="#Struct_types">struct types</a>.
Any other type has an empty method set.
In a method set, each method must have a
<a href="#Uniqueness_of_identifiers">unique</a> <a href="#MethodName">method name</a>.
@@ -955,28 +957,39 @@ struct {
</pre>
<p>
-Fields and methods (§<a href="#Method_declarations">Method declarations</a>) of an anonymous field are
-promoted to be ordinary fields and methods of the struct (§<a href="#Selectors">Selectors</a>).
-The following rules apply for a struct type <code>S</code> and
-a type named <code>T</code>:
+A field or <a href="#Method_declarations">method</a> <code>f</code> of an
+anonymous field in a struct <code>x</code> is called <i>promoted</i> if
+<code>x.f</code> is a legal <a href="#Selectors">selector</a> that denotes
+that field or method <code>f</code>.
</p>
-<ul>
- <li>If <code>S</code> contains an anonymous field <code>T</code>, the
- <a href="#Method_sets">method set</a> of <code>S</code> includes the
- method set of <code>T</code>.
- </li>
- <li>If <code>S</code> contains an anonymous field <code>*T</code>, the
- method set of <code>S</code> includes the method set of <code>*T</code>
- (which itself includes the method set of <code>T</code>).
- </li>
+<p>
+Promoted fields act like ordinary fields
+of a struct except that they cannot be used as field names in
+<a href="#Composite_literals">composite literals</a> of the struct.
+</p>
- <li>If <code>S</code> contains an anonymous field <code>T</code> or
- <code>*T</code>, the method set of <code>*S</code> includes the
- method set of <code>*T</code> (which itself includes the method
- set of <code>T</code>).
+<p>
+Given a struct type <code>S</code> and a type named <code>T</code>,
+promoted methods are included in the method set of the struct as follows:
+</p>
+<ul>
+ <li>
+ If <code>S</code> contains an anonymous field <code>T</code>,
+ the <a href="#Method_sets">method sets</a> of <code>S</code>
+ and <code>*S</code> both include promoted methods with receiver
+ <code>T</code>. The method set of <code>*S</code> also
+ includes promoted methods with receiver <code>*T</code>.
+ </li>
+
+ <li>
+ If <code>S</code> contains an anonymous field <code>*T</code>,
+ the method sets of <code>S</code> and <code>*S</code> both
+ include promoted methods with receiver <code>T</code> or
+ <code>*T</code>.
</li>
</ul>
+
<p>
A field declaration may be followed by an optional string literal <i>tag</i>,
which becomes an attribute for all the fields in the corresponding
@@ -3866,7 +3879,11 @@ x, _ = f() // ignore second value returned by f()
In the second form, the number of operands on the left must equal the number
of expressions on the right, each of which must be single-valued, and the
<i>n</i>th expression on the right is assigned to the <i>n</i>th
-operand on the left. The assignment proceeds in two phases.
+operand on the left.
+</p>
+
+<p>
+The assignment proceeds in two phases.
First, the operands of <a href="#Indexes">index expressions</a>
and <a href="#Address_operators">pointer indirections</a>
(including implicit pointer indirections in <a href="#Selectors">selectors</a>)
@@ -3885,13 +3902,20 @@ i, x[i] = 1, 2 // set i = 1, x[0] = 2
i = 0
x[i], i = 2, 1 // set x[0] = 2, i = 1
-x[0], x[0] = 1, 2 // set x[0] = 1, then x[0] = 2 (so x[0] = 2 at end)
+x[0], x[0] = 1, 2 // set x[0] = 1, then x[0] = 2 (so x[0] == 2 at end)
x[1], x[3] = 4, 5 // set x[1] = 4, then panic setting x[3] = 5.
type Point struct { x, y int }
var p *Point
x[2], p.x = 6, 7 // set x[2] = 6, then panic setting p.x = 7
+
+i = 2
+x = []int{3, 5, 7}
+for i, x[i] = range x { // set i, x[2] = 0, x[0]
+ break
+}
+// after this loop, i == 0 and x == []int{3, 5, 3}
</pre>
<p>
diff --git a/doc/install-source.html b/doc/install-source.html
index 080bceb4d..87c187ba8 100644
--- a/doc/install-source.html
+++ b/doc/install-source.html
@@ -170,7 +170,6 @@ ALL TESTS PASSED
Installed Go for linux/amd64 in /home/you/go.
Installed commands in /home/you/go/bin.
*** You need to add /home/you/go/bin to your $PATH. ***
-The compiler is 6g.
</pre>
<p>
diff --git a/doc/install.html b/doc/install.html
index ad3eaf338..b856836ff 100644
--- a/doc/install.html
+++ b/doc/install.html
@@ -24,6 +24,32 @@ For information about installing <code>gccgo</code>, see
<a href="/doc/install/gccgo">Setting up and using gccgo</a>.
</p>
+<h2 id="requirements">System requirements</h2>
+<p>
+The <code>gc</code> compiler supports the following operating systems and
+architectures. Please ensure your system meets these requirements before
+proceeding. If your OS or architecture is not on the list, it's possible that
+<code>gccgo</code> might support your setup; see
+<a href="/doc/install/gccgo">Setting up and using gccgo</a> for details.
+</p>
+
+<table class="codetable" frame="border" summary="requirements">
+<tr>
+<th align="middle">Operating system</th>
+<th align="middle">Architectures</th>
+<th align="middle">Notes</th>
+</tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><td>FreeBSD 7 or later</td> <td>amd64, 386</td> <td>Debian GNU/kFreeBSD not supported</td></tr>
+<tr><td>Linux 2.6.23 or later with glibc</td> <td>amd64, 386, arm</td> <td>CentOS/RHEL 5.x not supported; no binary distribution for ARM yet</tr>
+<tr><td>Mac OS X 10.6/10.7</td> <td>amd64, 386</td> <td>use the gcc<sup>&#8224;</sup> that comes with Xcode</td></tr>
+<tr><td>Windows 2000 or later</td> <td>amd64, 386</td> <td>use mingw gcc<sup>&#8224;</sup>; cygwin or msys is not needed</td></tr>
+</table>
+
+<p>
+<sup>&#8224;</sup><code>gcc</code> is required only if you plan to use <a href="/cmd/cgo">cgo</a>.
+</p>
+
<h2 id="download">Download the Go tools</h2>
<p>
diff --git a/doc/style.css b/doc/style.css
index 7f3384c6c..a0c632098 100644
--- a/doc/style.css
+++ b/doc/style.css
@@ -373,6 +373,7 @@ div#blog .read {
.toggleVisible .expanded { display: block; }
table.codetable { margin-left: auto; margin-right: auto; border-style: none; }
+table.codetable td { padding-right: 10px; }
hr { border-style: none; border-top: 1px solid black; }
img.gopher {
diff --git a/doc/talks/go_talk-20091030.pdf b/doc/talks/go_talk-20091030.pdf
new file mode 100644
index 000000000..5139ff2bd
--- /dev/null
+++ b/doc/talks/go_talk-20091030.pdf
Binary files differ