reduce file size

This commit is contained in:
chai2010
2015-12-25 12:39:07 +08:00
parent 2284164524
commit 35b11c0ff4
154 changed files with 271 additions and 9724 deletions

View File

@@ -25,10 +25,6 @@
<link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
@@ -48,7 +44,7 @@
<body>
<div class="book" data-level="13.1" data-chapter-title="unsafe.Sizeof, Alignof 和 Offsetof" data-filepath="ch13/ch13-01.md" data-basepath=".." data-revision="Thu Dec 24 2015 14:42:02 GMT+0800 (中国标准时间)">
<div class="book" data-level="13.1" data-chapter-title="unsafe.Sizeof, Alignof 和 Offsetof" data-filepath="ch13/ch13-01.md" data-basepath=".." data-revision="Fri Dec 25 2015 12:32:44 GMT+0800 (中国标准时间)">
<div class="book-summary">
@@ -2132,14 +2128,6 @@ Sizeof(x.c) = 24 Alignof(x.c) = 8 Offsetof(x.c) = 8
<script src="../gitbook/app.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
@@ -2149,7 +2137,7 @@ Sizeof(x.c) = 24 Alignof(x.c) = 8 Offsetof(x.c) = 8
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
var config = {"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>

View File

@@ -25,10 +25,6 @@
<link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
@@ -48,7 +44,7 @@
<body>
<div class="book" data-level="13.2" data-chapter-title="unsafe.Pointer" data-filepath="ch13/ch13-02.md" data-basepath=".." data-revision="Thu Dec 24 2015 14:42:02 GMT+0800 (中国标准时间)">
<div class="book" data-level="13.2" data-chapter-title="unsafe.Pointer" data-filepath="ch13/ch13-02.md" data-basepath=".." data-revision="Fri Dec 25 2015 12:32:44 GMT+0800 (中国标准时间)">
<div class="book-summary">
@@ -2061,7 +2057,7 @@ pb := (*<span class="hljs-typename">int16</span>)(unsafe.Pointer(tmp))
</code></pre>
<p>&#x9019;&#x91CC;&#x4F75;&#x6C92;&#x6709;&#x6307;&#x91DD;&#x5F15;&#x7528;<code>new</code>&#x65B0;&#x5275;&#x5EFA;&#x7684;&#x8B8A;&#x91CF;&#xFF0C;&#x56E0;&#x6B64;&#x8A72;&#x8A9E;&#x53E5;&#x57F7;&#x884C;&#x5B8C;&#x6210;&#x4E4B;&#x5F8C;&#xFF0C;&#x5783;&#x573E;&#x6536;&#x96C6;&#x5668;&#x6709;&#x6B0A;&#x99AC;&#x4E0A;&#x8FF4;&#x6536;&#x5176;&#x5167;&#x5B58;&#x7A7A;&#x9593;&#xFF0C;&#x6240;&#x4EE5;&#x8FD4;&#x8FF4;&#x7684;pT&#x5C07;&#x662F;&#x7121;&#x6548;&#x7684;&#x5730;&#x5740;&#x3002;</p>
<p>&#x96D6;&#x7136;&#x76EE;&#x524D;&#x7684;Go&#x8A9E;&#x8A00;&#x5BE6;&#x73FE;&#x9084;&#x6C92;&#x6709;&#x4F7F;&#x7528;&#x79FB;&#x52D5;GC&#xFF08;&#x8B6F;&#x8A3B;&#xFF1A;&#x672A;&#x4F86;&#x53EF;&#x80FD;&#x5BE6;&#x73FE;&#xFF09;&#xFF0C;&#x4F46;&#x9019;&#x4E0D;&#x8A72;&#x662F;&#x7DE8;&#x5BEB;&#x932F;&#x8AA4;&#x4EE3;&#x78BC;&#x50E5;&#x5E78;&#x7684;&#x7406;&#x7531;&#xFF1A;&#x7576;&#x524D;&#x7684;Go&#x8A9E;&#x8A00;&#x5BE6;&#x73FE;&#x5DF2;&#x7D93;&#x6709;&#x79FB;&#x52D5;&#x8B8A;&#x91CF;&#x7684;&#x5834;&#x666F;&#x3002;&#x5728;5.2&#x7BC0;&#x6211;&#x5011;&#x63D0;&#x5230;goroutine&#x7684;&#x68E7;&#x662F;&#x6839;&#x64DA;&#x9700;&#x8981;&#x52D5;&#x614B;&#x589E;&#x9577;&#x7684;&#x3002;&#x7576;&#x767C;&#x9001;&#x68E7;&#x52D5;&#x614B;&#x589E;&#x9577;&#x7684;&#x6642;&#x5019;&#xFF0C;&#x539F;&#x4F86;&#x68E7;&#x4E2D;&#x7684;&#x6240;&#x4EE5;&#x8B8A;&#x91CF;&#x53EF;&#x80FD;&#x9700;&#x8981;&#x88AB;&#x79FB;&#x52D5;&#x5230;&#x65B0;&#x7684;&#x66F4;&#x5927;&#x7684;&#x68E7;&#x4E2D;&#xFF0C;&#x6240;&#x4EE5;&#x6211;&#x5011;&#x4F75;&#x4E0D;&#x80FD;&#x78BA;&#x4FDD;&#x8B8A;&#x91CF;&#x7684;&#x5730;&#x5740;&#x5728;&#x6574;&#x500B;&#x4F7F;&#x7528;&#x9031;&#x671F;&#x5167;&#x662F;&#x4E0D;&#x8B8A;&#x7684;&#x3002;</p>
<p>&#x5728;&#x7DE8;&#x5BEB;&#x672C;&#x6587;&#x6642;&#xFF0C;&#x9084;&#x6C92;&#x6709;&#x6E05;&#x6670;&#x7684;&#x539F;&#x5247;&#x4F86;&#x6307;&#x5F15;Go&#x7A0B;&#x5E8F;&#x54E1;&#xFF0C;&#x4EC0;&#x9EBD;&#x6A23;&#x7684;unsafe.Pointer&#x548C;uintptr&#x7684;&#x8F49;&#x63DB;&#x662F;&#x4E0D;&#x5B89;&#x5168;&#x7684;&#xFF08;&#x53C3;&#x8003; [Go issue7192](<a href="https://github.com/golang/go/issues/7192" target="_blank">https://github.com/golang/go/issues/7192</a> &#xFF09;. &#x8B6F;&#x8A3B;: &#x8A72;&#x554F;&#x984C;&#x5DF2;&#x7D93;&#x95DC;&#x9589;&#xFF09;&#xFF0C;&#x56E0;&#x6B64;&#x6211;&#x5011;&#x5F37;&#x70C8;&#x5EFA;&#x8B70;&#x6309;&#x7167;&#x6700;&#x58DE;&#x7684;&#x65B9;&#x5F0F;&#x8655;&#x7406;&#x3002;&#x5C07;&#x6240;&#x6709;&#x5305;&#x542B;&#x8B8A;&#x91CF;&#x5730;&#x5740;&#x7684;uintptr&#x985E;&#x578B;&#x8B8A;&#x91CF;&#x7576;&#x4F5C;BUG&#x8655;&#x7406;&#xFF0C;&#x540C;&#x6642;&#x6E1B;&#x5C11;&#x4E0D;&#x5FC5;&#x8981;&#x7684;unsafe.Pointer&#x985E;&#x578B;&#x5230;uintptr&#x985E;&#x578B;&#x7684;&#x8F49;&#x63DB;&#x3002;&#x5728;&#x7B2C;&#x4E00;&#x500B;&#x4F8B;&#x5B50;&#x4E2D;&#xFF0C;&#x6709;&#x4E09;&#x500B;&#x8F49;&#x63DB;&#x2014;&#x2014;&#x5B57;&#x6BB5;&#x504F;&#x79FB;&#x91CF;&#x5230;uintptr&#x7684;&#x8F49;&#x63DB;&#x548C;&#x8F49;&#x8FF4;unsafe.Pointer&#x985E;&#x578B;&#x7684;&#x64CD;&#x4F5C;&#x2014;&#x2014;&#x6240;&#x6709;&#x7684;&#x8F49;&#x63DB;&#x5168;&#x5728;&#x4E00;&#x500B;&#x8868;&#x9054;&#x5F0F;&#x5B8C;&#x6210;&#x3002;</p>
<p>&#x5728;&#x7DE8;&#x5BEB;&#x672C;&#x6587;&#x6642;&#xFF0C;&#x9084;&#x6C92;&#x6709;&#x6E05;&#x6670;&#x7684;&#x539F;&#x5247;&#x4F86;&#x6307;&#x5F15;Go&#x7A0B;&#x5E8F;&#x54E1;&#xFF0C;&#x4EC0;&#x9EBD;&#x6A23;&#x7684;unsafe.Pointer&#x548C;uintptr&#x7684;&#x8F49;&#x63DB;&#x662F;&#x4E0D;&#x5B89;&#x5168;&#x7684;&#xFF08;&#x53C3;&#x8003; <a href="https://github.com/golang/go/issues/7192" target="_blank">Issue7192</a> &#xFF09;. &#x8B6F;&#x8A3B;: &#x8A72;&#x554F;&#x984C;&#x5DF2;&#x7D93;&#x95DC;&#x9589;&#xFF09;&#xFF0C;&#x56E0;&#x6B64;&#x6211;&#x5011;&#x5F37;&#x70C8;&#x5EFA;&#x8B70;&#x6309;&#x7167;&#x6700;&#x58DE;&#x7684;&#x65B9;&#x5F0F;&#x8655;&#x7406;&#x3002;&#x5C07;&#x6240;&#x6709;&#x5305;&#x542B;&#x8B8A;&#x91CF;&#x5730;&#x5740;&#x7684;uintptr&#x985E;&#x578B;&#x8B8A;&#x91CF;&#x7576;&#x4F5C;BUG&#x8655;&#x7406;&#xFF0C;&#x540C;&#x6642;&#x6E1B;&#x5C11;&#x4E0D;&#x5FC5;&#x8981;&#x7684;unsafe.Pointer&#x985E;&#x578B;&#x5230;uintptr&#x985E;&#x578B;&#x7684;&#x8F49;&#x63DB;&#x3002;&#x5728;&#x7B2C;&#x4E00;&#x500B;&#x4F8B;&#x5B50;&#x4E2D;&#xFF0C;&#x6709;&#x4E09;&#x500B;&#x8F49;&#x63DB;&#x2014;&#x2014;&#x5B57;&#x6BB5;&#x504F;&#x79FB;&#x91CF;&#x5230;uintptr&#x7684;&#x8F49;&#x63DB;&#x548C;&#x8F49;&#x8FF4;unsafe.Pointer&#x985E;&#x578B;&#x7684;&#x64CD;&#x4F5C;&#x2014;&#x2014;&#x6240;&#x6709;&#x7684;&#x8F49;&#x63DB;&#x5168;&#x5728;&#x4E00;&#x500B;&#x8868;&#x9054;&#x5F0F;&#x5B8C;&#x6210;&#x3002;</p>
<p>&#x7576;&#x8ABF;&#x7528;&#x4E00;&#x500B;&#x5EAB;&#x51FD;&#x6578;&#xFF0C;&#x4F75;&#x4E14;&#x8FD4;&#x8FF4;&#x7684;&#x662F;uintptr&#x985E;&#x578B;&#x5730;&#x5740;&#x6642;&#xFF08;&#x8B6F;&#x8A3B;&#xFF1A;&#x666E;&#x901A;&#x65B9;&#x6CD5;&#x5BE6;&#x73FE;&#x7684;&#x51FD;&#x6578;&#x4E0D;&#x76E1;&#x91CF;&#x4E0D;&#x8981;&#x8FD4;&#x8FF4;&#x8A72;&#x985E;&#x578B;&#x3002;&#x4E0B;&#x9762;&#x4F8B;&#x5B50;&#x662F;reflect&#x5305;&#x7684;&#x51FD;&#x6578;&#xFF0C;reflect&#x5305;&#x548C;unsafe&#x5305;&#x4E00;&#x6A23;&#x90FD;&#x662F;&#x91C7;&#x7528;&#x7279;&#x6B8A;&#x6280;&#x8853;&#x5BE6;&#x73FE;&#x7684;&#xFF0C;&#x7DE8;&#x8B6F;&#x5668;&#x53EF;&#x80FD;&#x7D66;&#x5B83;&#x5011;&#x958B;&#x4E86;&#x5F8C;&#x9580;&#xFF09;&#xFF0C;&#x6BD4;&#x5982;&#x4E0B;&#x9762;&#x53CD;&#x5C04;&#x5305;&#x4E2D;&#x7684;&#x76F8;&#x95DC;&#x51FD;&#x6578;&#xFF0C;&#x8FD4;&#x8FF4;&#x7684;&#x7D50;&#x679C;&#x61C9;&#x8A72;&#x7ACB;&#x537D;&#x8F49;&#x63DB;&#x7232;unsafe.Pointer&#x4EE5;&#x78BA;&#x4FDD;&#x6307;&#x91DD;&#x6307;&#x5411;&#x7684;&#x662F;&#x76F8;&#x540C;&#x7684;&#x8B8A;&#x91CF;&#x3002;</p>
<pre><code class="lang-Go"><span class="hljs-keyword">package</span> reflect
@@ -2091,14 +2087,6 @@ pb := (*<span class="hljs-typename">int16</span>)(unsafe.Pointer(tmp))
<script src="../gitbook/app.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
@@ -2108,7 +2096,7 @@ pb := (*<span class="hljs-typename">int16</span>)(unsafe.Pointer(tmp))
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
var config = {"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>

View File

@@ -25,10 +25,6 @@
<link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
@@ -48,7 +44,7 @@
<body>
<div class="book" data-level="13.3" data-chapter-title="示例: 深度相等判斷" data-filepath="ch13/ch13-03.md" data-basepath=".." data-revision="Thu Dec 24 2015 14:42:02 GMT+0800 (中国标准时间)">
<div class="book" data-level="13.3" data-chapter-title="示例: 深度相等判斷" data-filepath="ch13/ch13-03.md" data-basepath=".." data-revision="Fri Dec 25 2015 12:32:44 GMT+0800 (中国标准时间)">
<div class="book-summary">
@@ -2149,14 +2145,6 @@ fmt.Println(Equal(a, c)) <span class="hljs-comment">// &quot;false&quot;</span>
<script src="../gitbook/app.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
@@ -2166,7 +2154,7 @@ fmt.Println(Equal(a, c)) <span class="hljs-comment">// &quot;false&quot;</span>
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
var config = {"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>

View File

@@ -25,10 +25,6 @@
<link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
@@ -48,7 +44,7 @@
<body>
<div class="book" data-level="13.4" data-chapter-title="通過cgo調用C代碼" data-filepath="ch13/ch13-04.md" data-basepath=".." data-revision="Thu Dec 24 2015 14:42:02 GMT+0800 (中国标准时间)">
<div class="book" data-level="13.4" data-chapter-title="通過cgo調用C代碼" data-filepath="ch13/ch13-04.md" data-basepath=".." data-revision="Fri Dec 25 2015 12:32:44 GMT+0800 (中国标准时间)">
<div class="book-summary">
@@ -2159,7 +2155,7 @@ void bz2free(bz_stream* s) { free(s); }
}
}
</code></pre>
<p>&#x58D3;&#x7E2E;&#x5B8C;&#x6210;&#x5F8C;&#xFF0C;Close&#x65B9;&#x6CD5;&#x7528;&#x4E86;defer&#x51FD;&#x6578;&#x78BA;&#x4FDD;&#x51FD;&#x6578;&#x9000;&#x9F63;&#x524D;&#x8ABF;&#x7528;C.BZ2_bzCompressEnd&#x548C;C.bz2free&#x91CB;&#x653E;&#x76F8;&#x95DC;&#x7684;C&#x8CC7;&#x6E90;&#x3002;&#x6B64;&#x523B;w.stream&#x6307;&#x91DD;&#x5C07;&#x4E0D;&#x5728;&#x6709;&#x6548;&#xFF0C;&#x6211;&#x5011;&#x5C07;&#x5B83;&#x8A2D;&#x7F6E;&#x7232;nil&#x4EE5;&#x4FDD;&#x8B49;&#x5B89;&#x5168;&#xFF0C;&#x7136;&#x5F8C;&#x5728;&#x6BCF;&#x500B;&#x65B9;&#x6CD5;&#x4E2D;&#x589E;&#x52A0;&#x4E86;nil&#x6AA2;&#x6E2C;&#xFF0C;&#x4EE5;&#x9632;&#x6B62;&#x7528;&#x6236;&#x5728;&#x95DC;&#x9589;&#x5F8C;&#x4F9D;&#x7136;&#x932F;&#x8AA4;&#x4F7F;&#x7528;&#x76F8;&#x95DC;&#x65B9;&#x6CD5;&#x3002;</p>
<p>&#x58D3;&#x7E2E;&#x5B8C;&#x6210;&#x5F8C;&#xFF0C;Close&#x65B9;&#x6CD5;&#x7528;&#x4E86;defer&#x51FD;&#x6578;&#x78BA;&#x4FDD;&#x51FD;&#x6578;&#x9000;&#x9F63;&#x524D;&#x8ABF;&#x7528;C.BZ2_bzCompressEnd&#x548C;C.bz2free&#x91CB;&#x653E;&#x76F8;&#x95DC;&#x7684;C&#x8BED;&#x8A00;&#x8FD0;&#x884C;&#x65F6;&#x8CC7;&#x6E90;&#x3002;&#x6B64;&#x523B;w.stream&#x6307;&#x91DD;&#x5C07;&#x4E0D;&#x518D;&#x6709;&#x6548;&#xFF0C;&#x6211;&#x5011;&#x5C07;&#x5B83;&#x8A2D;&#x7F6E;&#x7232;nil&#x4EE5;&#x4FDD;&#x8B49;&#x5B89;&#x5168;&#xFF0C;&#x7136;&#x5F8C;&#x5728;&#x6BCF;&#x500B;&#x65B9;&#x6CD5;&#x4E2D;&#x589E;&#x52A0;&#x4E86;nil&#x6AA2;&#x6E2C;&#xFF0C;&#x4EE5;&#x9632;&#x6B62;&#x7528;&#x6236;&#x5728;&#x95DC;&#x9589;&#x5F8C;&#x4F9D;&#x7136;&#x932F;&#x8AA4;&#x4F7F;&#x7528;&#x76F8;&#x95DC;&#x65B9;&#x6CD5;&#x3002;</p>
<p>&#x4E0A;&#x9762;&#x7684;&#x5BE6;&#x73FE;&#x4E2D;&#xFF0C;&#x4E0D;&#x50C5;&#x50C5;&#x5BEB;&#x662F;&#x975E;&#x4F75;&#x767C;&#x5B89;&#x5168;&#x7684;&#xFF0C;&#x751A;&#x81F3;&#x4F75;&#x767C;&#x8ABF;&#x7528;Close&#x548C;Write&#x65B9;&#x6CD5;&#x4E5F;&#x53EF;&#x80FD;&#x5C0E;&#x81F4;&#x7A0B;&#x5E8F;&#x7684;&#x7684;&#x5D29;&#x6F70;&#x3002;&#x8129;&#x8907;&#x9019;&#x500B;&#x554F;&#x984C;&#x662F;&#x7DF4;&#x7FD2;13.3&#x7684;&#x5167;&#x5BB9;&#x3002;</p>
<p>&#x4E0B;&#x9762;&#x7684;bzipper&#x7A0B;&#x5E8F;&#xFF0C;&#x4F7F;&#x7528;&#x6211;&#x5011;&#x81EA;&#x5DF1;&#x5305;&#x5BE6;&#x73FE;&#x7684;bzip2&#x58D3;&#x7E2E;&#x547D;&#x4EE4;&#x3002;&#x5B83;&#x7684;&#x884C;&#x7232;&#x548C;&#x8A31;&#x591A;Unix&#x7E6B;&#x7D71;&#x7684;bzip2&#x547D;&#x4EE4;&#x985E;&#x4F3C;&#x3002;</p>
<pre><code class="lang-Go">gopl.io/ch13/bzipper
@@ -2196,7 +2192,7 @@ $ ./bzipper &lt; /usr/share/dict/words | bunzip2 | sha256sum
126a4ef38493313edc50b86f90dfdaf7c59ec6c948451eac228f2f3a8ab1a6ed -
</code></pre><p>&#x6211;&#x5011;&#x6F14;&#x793A;&#x4E86;&#x5982;&#x4F55;&#x5C07;&#x4E00;&#x500B;C&#x8A9E;&#x8A00;&#x5EAB;&#x93C8;&#x63A5;&#x5230;Go&#x8A9E;&#x8A00;&#x7A0B;&#x5E8F;&#x3002;&#x76F8;&#x53CD;, &#x5C07;Go&#x7DE8;&#x8B6F;&#x7232;&#x975C;&#x614B;&#x5EAB;&#x7136;&#x5F8C;&#x93C8;&#x63A5;&#x5230;C&#x7A0B;&#x5E8F;&#xFF0C;&#x6216;&#x8005;&#x5C07;Go&#x7A0B;&#x5E8F;&#x7DE8;&#x8B6F;&#x7232;&#x52D5;&#x614B;&#x5EAB;&#x7136;&#x5F8C;&#x5728;C&#x7A0B;&#x5E8F;&#x4E2D;&#x52D5;&#x614B;&#x52A0;&#x8F09;&#x4E5F;&#x90FD;&#x662F;&#x53EF;&#x884C;&#x7684;&#xFF08;&#x8B6F;&#x8A3B;&#xFF1A;&#x5728;Go1.5&#x4E2D;&#xFF0C;Windows&#x7E6B;&#x7D71;&#x7684;Go&#x8A9E;&#x8A00;&#x5BE6;&#x73FE;&#x4F75;&#x4E0D;&#x652F;&#x6301;&#x751F;&#x6210;C&#x8A9E;&#x8A00;&#x52D5;&#x614B;&#x5EAB;&#x6216;&#x975C;&#x614B;&#x5EAB;&#x7684;&#x7279;&#x6027;&#x3002;&#x4E0D;&#x904E;&#x597D;&#x6D88;&#x606F;&#x662F;&#xFF0C;&#x76EE;&#x524D;&#x5DF2;&#x7D93;&#x6709;&#x4EBA;&#x5728;&#x5690;&#x8A66;&#x89E3;&#x6C7A;&#x9019;&#x500B;&#x554F;&#x984C;&#xFF0C;&#x5177;&#x9AD4;&#x8ACB;&#x8A2A;&#x554F; <a href="https://github.com/golang/go/issues/11058" target="_blank">Issue11058</a> &#xFF09;&#x3002;&#x9019;&#x91CC;&#x6211;&#x5011;&#x96BB;&#x5C55;&#x793A;&#x7684;cgo&#x5F88;&#x5C0F;&#x7684;&#x4E00;&#x4E9B;&#x65B9;&#x9762;&#xFF0C;&#x66F4;&#x591A;&#x7684;&#x95DC;&#x65BC;&#x5167;&#x5B58;&#x7BA1;&#x7406;&#x3001;&#x6307;&#x91DD;&#x3001;&#x8FF4;&#x8ABF;&#x51FD;&#x6578;&#x3001;&#x4E2D;&#x65B7;&#x4FE1;&#x865F;&#x8655;&#x7406;&#x3001;&#x5B57;&#x7B26;&#x4E32;&#x3001;errno&#x8655;&#x7406;&#x3001;&#x7D42;&#x7D50;&#x5668;&#xFF0C;&#x4EE5;&#x53CA;goroutines&#x548C;&#x7E6B;&#x7D71;&#x7DDA;&#x7A0B;&#x7684;&#x95DC;&#x7E6B;&#x7B49;&#xFF0C;&#x6709;&#x5F88;&#x591A;&#x7D30;&#x7BC0;&#x53EF;&#x4EE5;&#x8A0E;&#x8AD6;&#x3002;&#x7279;&#x522B;&#x662F;&#x5982;&#x4F55;&#x5C07;Go&#x8A9E;&#x8A00;&#x7684;&#x6307;&#x91DD;&#x50B3;&#x5165;C&#x51FD;&#x6578;&#x7684;&#x898F;&#x5247;&#x4E5F;&#x662F;&#x7570;&#x5E38;&#x8907;&#x96DC;&#x7684;&#xFF08;&#x8B6F;&#x8A3B;&#xFF1A;&#x7C21;&#x55AE;&#x4F86;&#x8AAC;&#xFF0C;&#x8981;&#x50B3;&#x5165;C&#x51FD;&#x6578;&#x7684;Go&#x6307;&#x91DD;&#x6307;&#x5411;&#x7684;&#x6578;&#x64DA;&#x672C;&#x8EAB;&#x4E0D;&#x80FD;&#x5305;&#x542B;&#x6307;&#x91DD;&#x6216;&#x5176;&#x4ED6;&#x5F15;&#x7528;&#x985E;&#x578B;&#xFF1B;&#x4F75;&#x4E14;C&#x51FD;&#x6578;&#x5728;&#x8FD4;&#x8FF4;&#x5F8C;&#x4E0D;&#x80FD;&#x7E7C;&#x7E8C;&#x6301;&#x6709;Go&#x6307;&#x91DD;&#xFF1B;&#x4F75;&#x4E14;&#x5728;C&#x51FD;&#x6578;&#x8FD4;&#x8FF4;&#x4E4B;&#x524D;&#xFF0C;Go&#x6307;&#x91DD;&#x662F;&#x88AB;&#x9396;&#x5B9A;&#x7684;&#xFF0C;&#x4E0D;&#x80FD;&#x5C0E;&#x81F4;&#x5C0D;&#x61C9;&#x6307;&#x91DD;&#x6578;&#x64DA;&#x88AB;&#x79FB;&#x52D5;&#x6216;&#x68E7;&#x7684;&#x8ABF;&#x6574;&#xFF09;&#xFF0C;&#x90E8;&#x5206;&#x7684;&#x539F;&#x56E0;&#x5728;13.2&#x7BC0;&#x6709;&#x8A0E;&#x8AD6;&#x5230;&#xFF0C;&#x4F46;&#x662F;&#x5728;Go1.5&#x4E2D;&#x9084;&#x6C92;&#x6709;&#x88AB;&#x660E;&#x78BA;&#xFF08;&#x8B6F;&#x8A3B;&#xFF1A;Go1.6&#x5C07;&#x6703;&#x660E;&#x78BA;cgo&#x4E2D;&#x7684;&#x6307;&#x91DD;&#x4F7F;&#x7528;&#x898F;&#x5247;&#xFF09;&#x3002;&#x5982;&#x679C;&#x8981;&#x9032;&#x4E00;&#x6B65;&#x95B2;&#x8B80;&#xFF0C;&#x53EF;&#x4EE5;&#x5F9E; <a href="https://golang.org/cmd/cgo" target="_blank">https://golang.org/cmd/cgo</a> &#x958B;&#x59CB;&#x3002;</p>
<p><strong>&#x7DF4;&#x7FD2; 13.3&#xFF1A;</strong> &#x4F7F;&#x7528;sync.Mutex&#x4EE5;&#x4FDD;&#x8B49;bzip2.writer&#x5728;&#x591A;&#x500B;goroutines&#x4E2D;&#x88AB;&#x4F75;&#x767C;&#x8ABF;&#x7528;&#x662F;&#x5B89;&#x5168;&#x7684;&#x3002;</p>
<p><strong>&#x7DF4;&#x7FD2; 13.4&#xFF1A;</strong> &#x56E0;&#x7232;C&#x5EAB;&#x4F9D;&#x8CF4;&#x7684;&#x9650;&#x88FD;&#x3002; &#x4F7F;&#x7528;os/exec&#x5305;&#x555F;&#x52D5;/bin/bzip2&#x547D;&#x4EE4;&#x4F5C;&#x7232;&#x4E00;&#x500B;&#x5B50;&#x9032;&#x7A0B;&#xFF0C;&#x63D0;&#x4F9B;&#x4E00;&#x500B;&#x7D14;Go&#x7684;bzip.NewWriter&#x7684;&#x66FF;&#x4EE3;&#x5BE6;&#x73FE;&#xFF08;&#x8B6F;&#x8A3B;&#xFF1A;&#x96D6;&#x7136;&#x662F;&#x7D14;Go&#x5BE6;&#x73FE;&#xFF0C;&#x4F46;&#x662F;&#x904B;&#x884C;&#x6642;&#x5C07;&#x4F9D;&#x8CF4;/bin/bzip2&#x76EE;&#x9332;&#xFF0C;&#x5176;&#x4ED6;&#x64CD;&#x4F5C;&#x7E6B;&#x7D71;&#x53EF;&#x80FD;&#x7121;&#x6CD5;&#x904B;&#x884C;&#xFF09;&#x3002;</p>
<p><strong>&#x7DF4;&#x7FD2; 13.4&#xFF1A;</strong> &#x56E0;&#x7232;C&#x5EAB;&#x4F9D;&#x8CF4;&#x7684;&#x9650;&#x88FD;&#x3002; &#x4F7F;&#x7528;os/exec&#x5305;&#x555F;&#x52D5;/bin/bzip2&#x547D;&#x4EE4;&#x4F5C;&#x7232;&#x4E00;&#x500B;&#x5B50;&#x9032;&#x7A0B;&#xFF0C;&#x63D0;&#x4F9B;&#x4E00;&#x500B;&#x7D14;Go&#x7684;bzip.NewWriter&#x7684;&#x66FF;&#x4EE3;&#x5BE6;&#x73FE;&#xFF08;&#x8B6F;&#x8A3B;&#xFF1A;&#x96D6;&#x7136;&#x662F;&#x7D14;Go&#x5BE6;&#x73FE;&#xFF0C;&#x4F46;&#x662F;&#x904B;&#x884C;&#x6642;&#x5C07;&#x4F9D;&#x8CF4;/bin/bzip2&#x547D;&#x4EE4;&#xFF0C;&#x5176;&#x4ED6;&#x64CD;&#x4F5C;&#x7E6B;&#x7D71;&#x53EF;&#x80FD;&#x7121;&#x6CD5;&#x904B;&#x884C;&#xFF09;&#x3002;</p>
</section>
@@ -2219,14 +2215,6 @@ $ ./bzipper &lt; /usr/share/dict/words | bunzip2 | sha256sum
<script src="../gitbook/app.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
@@ -2236,7 +2224,7 @@ $ ./bzipper &lt; /usr/share/dict/words | bunzip2 | sha256sum
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
var config = {"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>

View File

@@ -25,10 +25,6 @@
<link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
@@ -48,7 +44,7 @@
<body>
<div class="book" data-level="13.5" data-chapter-title="幾點忠告" data-filepath="ch13/ch13-05.md" data-basepath=".." data-revision="Thu Dec 24 2015 14:42:02 GMT+0800 (中国标准时间)">
<div class="book" data-level="13.5" data-chapter-title="幾點忠告" data-filepath="ch13/ch13-05.md" data-basepath=".." data-revision="Fri Dec 25 2015 12:32:44 GMT+0800 (中国标准时间)">
<div class="book-summary">
@@ -2051,14 +2047,6 @@
<script src="../gitbook/app.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
@@ -2068,7 +2056,7 @@
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
var config = {"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>

View File

@@ -25,10 +25,6 @@
<link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
@@ -48,7 +44,7 @@
<body>
<div class="book" data-level="13" data-chapter-title="底層編程" data-filepath="ch13/ch13.md" data-basepath=".." data-revision="Thu Dec 24 2015 14:42:02 GMT+0800 (中国标准时间)">
<div class="book" data-level="13" data-chapter-title="底層編程" data-filepath="ch13/ch13.md" data-basepath=".." data-revision="Fri Dec 25 2015 12:32:44 GMT+0800 (中国标准时间)">
<div class="book-summary">
@@ -2055,14 +2051,6 @@
<script src="../gitbook/app.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
@@ -2072,7 +2060,7 @@
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
var config = {"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>