111 lines
3.4 KiB
HTML
111 lines
3.4 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
<head>
|
||
<title>The Go Programming Language - Errata</title>
|
||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||
<style>
|
||
body {
|
||
width: 38em;
|
||
margin: auto;
|
||
}
|
||
pre {
|
||
padding-left: 1em;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<h1>Errata</h1>
|
||
<p>
|
||
<b>p.9, ¶2</b>: for "can compared", read "can be compared".
|
||
(Thanks to Antonio Macías Ojeda, 2015-10-22.)
|
||
</p>
|
||
|
||
<p>
|
||
<b>p.13</b>: As printed, the <code>gopl.io/ch1/lissajous</code> program
|
||
is deterministic, not random. We've added the statement below to
|
||
the downloadable program so that it prints a pseudo-random image
|
||
each time it is run. (Thanks to Randall McPherson, 2015-10-19.)
|
||
</p>
|
||
<pre>rand.Seed(time.Now().UTC().UnixNano())</pre>
|
||
|
||
<p>
|
||
<b>p.19, ¶2</b>: For "Go's libraries makes", read "Go's library makes".
|
||
(Thanks to Victor Farazdagi, 2015-11-30.)
|
||
</p>
|
||
|
||
<p>
|
||
<b>p.40, ¶1</b>: The paragraph should end with a period, not a comma.
|
||
(Thanks to Victor Farazdagi, 2015-11-30.)
|
||
</p>
|
||
|
||
<p>
|
||
<b>p.43, ¶3</b>: Import declarations are explained in §10.4, not §10.3.
|
||
(Thanks to Peter Jurgensen, 2015-11-21.)
|
||
</p>
|
||
|
||
<p>
|
||
<b>p.52, ¶2</b>: for "an synonym", read "a synonym", twice.
|
||
</p>
|
||
|
||
<p>
|
||
<b>p.68</b>: the table of UTF-8 encodings is missing a bit from each first byte.
|
||
The corrected table is shown below. (Thanks to Akshay Kumar, 2015-11-02.)
|
||
</p>
|
||
|
||
<pre>
|
||
0xxxxxxx runes 0−127 (ASCII)
|
||
110xxxxx 10xxxxxx 128−2047 (values <128 unused)
|
||
1110xxxx 10xxxxxx 10xxxxxx 2048−65535 (values <2048 unused)
|
||
11110xxx 10xxxxxx 10xxxxxx 10xxxxxx 65536−0x10ffff (other values unused)</pre>
|
||
|
||
<p>
|
||
<b>p.74</b>: the comment in <code>gopl.io/ch3/printints</code> should say
|
||
<code>fmt.Sprint</code>, not <code>fmt.Sprintf</code>.
|
||
</p>
|
||
|
||
<p>
|
||
<b>p.76</b>: the comment <code>// "time.Duration 5ms0s</code> should have
|
||
a closing double-quotation mark.
|
||
</p>
|
||
|
||
<p>
|
||
<b>p.79, ¶4</b>: "When an untyped constant is
|
||
assigned to a variable, as in the first statement below, or
|
||
appears on the right-hand side of a variable declaration with an
|
||
explicit type, as in the other three statements, ..." has it backwards:
|
||
the <i>first</i>
|
||
statement is a declaration; the other three are assignments.
|
||
(Thanks to Yoshiki Shibata, 2015-11-09.)
|
||
</p>
|
||
|
||
<p>
|
||
<b>p.132, code display following ¶3</b>: the final comment
|
||
should read:<br/>
|
||
<code>// compile error: can't assign func(int, int) int to func(int) int</code><br/>
|
||
(Thanks to Toni Suter, 2015-11-21.)
|
||
</p>
|
||
|
||
<p>
|
||
<b>p.166, ¶2</b>: for "way", read "a way".
|
||
</p>
|
||
|
||
<p>
|
||
<b>p.362</b>: the <code>gopl.io/ch13/bzip</code> program
|
||
does not comply with the
|
||
<a href='https://github.com/golang/proposal/blob/master/design/12416-cgo-pointers.md'>proposed rules for passing pointers between Go and C code</a>
|
||
because the C function <code>bz2compress</code> temporarily stores a Go
|
||
pointer (<code>in</code>) into the Go heap
|
||
(the <code>bz_stream</code> variable).
|
||
|
||
The <code>bz_stream</code> variable should be allocated, and
|
||
explicitly freed after the call to
|
||
<code>BZ2_bzCompressEnd</code>, by C functions.
|
||
|
||
(Thanks to Joe Tsai, 2015-11-18.)
|
||
</p>
|
||
|
||
</body>
|
||
</html>
|