<buttonid="sidebar-toggle"class="icon-button"type="button"title="Toggle Table of Contents"aria-label="Toggle Table of Contents"aria-controls="sidebar">
<ahref="https://github.com/gopl-zh/gopl-zh.github.com/edit/master/./appendix/appendix-a-errata.md"title="Suggest an edit"aria-label="Suggest an edit">
<iid="git-edit-button"class="fa fa-edit"></i>
</a>
</div>
</div>
<divid="search-wrapper"class="hidden">
<formid="searchbar-outer"class="searchbar-outer">
<inputtype="search"id="searchbar"name="searchbar"placeholder="Search this book ..."aria-controls="searchresults-outer"aria-describedby="searchresults-header">
<p><strong>p.9, ¶2:</strong> for "can compared", read "can be compared". (Thanks to Antonio Macías Ojeda, 2015-10-22. Corrected in the second printing.)</p>
<p><strong>p.13:</strong> 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>
<p><strong>p.15, ¶2:</strong> For "inner loop", read "outer loop". (Thanks to Ralph Corderoy, 2015-11-28. Corrected in the third printing.)</p>
<p><strong>p.19, ¶2:</strong> For "Go's libraries makes", read "Go's library makes". (Thanks to Victor Farazdagi, 2015-11-30. Corrected in the third printing.)</p>
<p><strong>p.40, ¶4:</strong> For "value of the underlying type", read "value of an unnamed type with the same underlying type". (Thanks to Carlos Romero Brox, 2015-12-19.)</p>
<p><strong>p.40, ¶1:</strong> The paragraph should end with a period, not a comma. (Thanks to Victor Farazdagi, 2015-11-30. Corrected in the third printing.)</p>
<p><strong>p.43, ¶3:</strong> Import declarations are explained in §10.4, not §10.3. (Thanks to Peter Jurgensen, 2015-11-21. Corrected in the third printing.)</p>
<p><strong>p.48:</strong><code>f.ReadByte()</code> serves as an example of a reference to f, but <code>*os.File</code> has no such method. For "ReadByte", read "Stat", four times. (Thanks to Peter Olsen, 2016-01-06. Corrected in the third printing.)</p>
<p><strong>p.52, ¶2:</strong> for "an synonym", read "a synonym", twice. (Corrected in the second printing.)</p>
<p><strong>p.52, ¶9:</strong> for "The integer arithmetic operators", read "The arithmetic operators". (Thanks to Yoshiki Shibata, 2015-12-20.)</p>
<p><strong>p.68:</strong> 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. Corrected in the second printing.)</p>
<p><strong>p.73, ¶1:</strong> For "a exercise", read "an exercise". (Thanks to vrajmohan, 2015-12-28.)</p>
<p><strong>p.74:</strong> the comment in <code>gopl.io/ch3/printints</code> should say <code>fmt.Sprint</code>, not <code>fmt.Sprintf</code>. (Corrected in the second printing.)</p>
<p><strong>p.75, ¶4:</strong> for "%u", read "%o". (Thanks to William Hannish, 2015-12-21.)</p>
<p><strong>p.76:</strong> the comment <code>// "time.Duration 5m0s</code> should have a closing double-quotation mark. (Corrected in the second printing.)</p>
<p><strong>p.79, ¶4:</strong>"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. Corrected in the third printing.)</p>
<p><strong>p.112:</strong> Exercise 4.11 calls for a "CRUD" (create, read, update, delete) tool for GitHub Issues. Since GitHub does not currently allow Issues to be deleted, for "delete", read "close". (Thanks to Yoshiki Shibata, 2016-01-18.)</p>
<p><strong>p.115:</strong> The anchor element in <code>gopl.io/ch4/issueshtml</code>'s template is missing a closing <code></a></code> tag. (Thanks to Taj Khattra, 2016-01-19.)</p>
<p><strong>p.132, code display following ¶3:</strong> the final comment should read: <code>// compile error: can't assign func(int, int) int to func(int) int</code> (Thanks to Toni Suter, 2015-11-21. Corrected in the third printing.)</p>
<p><strong>p.160, ¶4:</strong><code>For Get("item"))</code>, read <code>Get("item")</code>. (Thanks to Yoshiki Shibata, 2016-02-01.)</p>
<p><strong>p.166, ¶2:</strong> for "way", read "a way". (Corrected in the third printing.)</p>
<p><strong>p.200, TestEval function:</strong> the format string in the final call to t.Errorf should format test.env with %v, not %s. (Thanks to Mitsuteru Sawa, 2015-12-07. Corrected in the third printing.)</p>
<p><strong>p.222, Exercise 8.1:</strong> The port numbers for <code>London</code> and <code>Tokyo</code> should be swapped in the final command to match the earlier commands. (Thanks to Kiyoshi Kamishima, 2016-01-08.)</p>
<p><strong>p.272, ¶3:</strong> for "the request body", read "the response body". (Thanks to <ahref="https://github.com/cch123">曹春晖</a>, 2016-01-19.)</p>
<p><strong>p.288, code display following ¶4:</strong> In the import declaration, for <code>"database/mysql"</code>, read <code>"database/sql"</code>. (Thanks to Jose Colon Rodriguez, 2016-01-09.)</p>
<p><strong>p.347, Exercise 12.8:</strong> for "like json.Marshal", read "like json.Unmarshal". (Thanks to <ahref="https://github.com/chai2010">chai2010</a>, 2016-01-01.)</p>
<p><strong>p.362:</strong> the <code>gopl.io/ch13/bzip</code> program does not comply with the <ahref="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 (in) 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. Corrected in the third printing.)</p>