2015-12-24 07:10:32 +00:00
|
|
|
|
# Go語言聖經(中文版)
|
2015-12-18 06:00:29 +00:00
|
|
|
|
|
|
|
|
|
* [前言](preface.md)
|
|
|
|
|
* [0.1. Go語言起源](ch0/ch0-01.md)
|
|
|
|
|
* [0.2. Go語言項目](ch0/ch0-02.md)
|
|
|
|
|
* [0.3. 本書的組織](ch0/ch0-03.md)
|
|
|
|
|
* [0.4. 更多的信息](ch0/ch0-04.md)
|
2015-12-18 06:49:31 +00:00
|
|
|
|
* [0.5. 致謝](ch0/ch0-05.md)
|
2015-12-18 06:00:29 +00:00
|
|
|
|
* [第一章 入門](ch1/ch1.md)
|
|
|
|
|
* [1.1. Hello, World](ch1/ch1-01.md)
|
|
|
|
|
* [1.2. 命令行參數](ch1/ch1-02.md)
|
2015-12-18 06:49:31 +00:00
|
|
|
|
* [1.3. 査找重複的行](ch1/ch1-03.md)
|
|
|
|
|
* [1.4. GIF動畵](ch1/ch1-04.md)
|
|
|
|
|
* [1.5. 穫取URL](ch1/ch1-05.md)
|
|
|
|
|
* [1.6. 併發穫取多個URL](ch1/ch1-06.md)
|
2015-12-18 06:00:29 +00:00
|
|
|
|
* [1.7. Web服務](ch1/ch1-07.md)
|
|
|
|
|
* [1.8. 本章要點](ch1/ch1-08.md)
|
|
|
|
|
* [第二章 程序結構](ch2/ch2.md)
|
|
|
|
|
* [2.1. 命名](ch2/ch2-01.md)
|
|
|
|
|
* [2.2. 聲明](ch2/ch2-02.md)
|
|
|
|
|
* [2.3. 變量](ch2/ch2-03.md)
|
|
|
|
|
* [2.3.1. 簡短變量聲明](ch2/ch2-03-1.md)
|
2015-12-18 06:49:31 +00:00
|
|
|
|
* [2.3.2 指針](ch2/ch2-03-2.md)
|
2015-12-18 06:00:29 +00:00
|
|
|
|
* [2.3.3 new 函數](ch2/ch2-03-3.md)
|
|
|
|
|
* [2.3.4. 變量的生命週期](ch2/ch2-03-4.md)
|
|
|
|
|
* [2.4. 賦值](ch2/ch2-04.md)
|
|
|
|
|
* [2.4.1. 元組賦值](ch2/ch2-04-1.md)
|
|
|
|
|
* [2.4.2. 可賦值性](ch2/ch2-04-2.md)
|
|
|
|
|
* [2.5. 類型](ch2/ch2-05.md)
|
|
|
|
|
* [2.6. 包和文件](ch2/ch2-06.md)
|
|
|
|
|
* [2.6.1. 導入包](ch2/ch2-06-1.md)
|
|
|
|
|
* [2.6.2. 包的初始化](ch2/ch2-06-2.md)
|
|
|
|
|
* [2.7. 作用域](ch2/ch2-07.md)
|
|
|
|
|
* [第三章 基礎數據類型](ch3/ch3.md)
|
|
|
|
|
* [3.1. 整型](ch3/ch3-01.md)
|
|
|
|
|
* [3.2. 浮點數](ch3/ch3-02.md)
|
2015-12-18 06:49:31 +00:00
|
|
|
|
* [3.3. 複數](ch3/ch3-03.md)
|
|
|
|
|
* [3.4. 布爾型](ch3/ch3-04.md)
|
2015-12-18 06:00:29 +00:00
|
|
|
|
* [3.5. 字符串](ch3/ch3-05.md)
|
|
|
|
|
* [3.5.1. 字符串面值](ch3/ch3-05-1.md)
|
|
|
|
|
* [3.5.2. Unicode](ch3/ch3-05-2.md)
|
|
|
|
|
* [3.5.3. UTF-8](ch3/ch3-05-3.md)
|
|
|
|
|
* [3.5.4. 字符串和Byte切片](ch3/ch3-05-4.md)
|
|
|
|
|
* [3.5.5. 字符串和數字的轉換](ch3/ch3-05-5.md)
|
|
|
|
|
* [3.6. 常量](ch3/ch3-06.md)
|
|
|
|
|
* [3.6.1. iota 常量生成器](ch3/ch3-06-1.md)
|
|
|
|
|
* [3.6.2. 無類型常量](ch3/ch3-06-2.md)
|
2015-12-18 06:49:31 +00:00
|
|
|
|
* [第四章 複合數據類型](ch4/ch4.md)
|
2015-12-18 06:00:29 +00:00
|
|
|
|
* [4.1. 數組](ch4/ch4-01.md)
|
|
|
|
|
* [4.2. 切片](ch4/ch4-02.md)
|
|
|
|
|
* [4.3. 字典](ch4/ch4-03.md)
|
|
|
|
|
* [4.4. 結構體](ch4/ch4-04.md)
|
|
|
|
|
* [4.5. JSON](ch4/ch4-05.md)
|
|
|
|
|
* [4.6. 文本和HTML模闆](ch4/ch4-06.md)
|
|
|
|
|
* [第五章 函數](ch5/ch5.md)
|
|
|
|
|
* [5.1. 函數聲明](ch5/ch5-01.md)
|
|
|
|
|
* [5.2. 遞歸](ch5/ch5-02.md)
|
|
|
|
|
* [5.3. 多返迴值](ch5/ch5-03.md)
|
|
|
|
|
* [5.4. 錯誤](ch5/ch5-04.md)
|
|
|
|
|
* [5.5. 函數值](ch5/ch5-05.md)
|
|
|
|
|
* [5.6. 匿名函數](ch5/ch5-06.md)
|
|
|
|
|
* [5.7. 可變參數](ch5/ch5-07.md)
|
|
|
|
|
* [5.8. Deferred函數](ch5/ch5-08.md)
|
|
|
|
|
* [5.9. Panic異常](ch5/ch5-09.md)
|
2015-12-18 06:49:31 +00:00
|
|
|
|
* [5.10. Recover捕穫異常](ch5/ch5-10.md)
|
2015-12-18 06:00:29 +00:00
|
|
|
|
* [第六章 方法](ch6/ch6.md)
|
|
|
|
|
* [6.1. 方法聲明](ch6/ch6-01.md)
|
2015-12-18 06:49:31 +00:00
|
|
|
|
* [6.2. 基於指針對象的方法](ch6/ch6-02.md)
|
2015-12-18 06:00:29 +00:00
|
|
|
|
* [6.3. 通過嵌入結構體來擴展類型](ch6/ch6-03.md)
|
|
|
|
|
* [6.4. 方法值和方法表達式](ch6/ch6-04.md)
|
|
|
|
|
* [6.5. 示例: Bit數組](ch6/ch6-05.md)
|
|
|
|
|
* [6.6. 封裝](ch6/ch6-06.md)
|
|
|
|
|
* [第七章 接口](ch7/ch7.md)
|
|
|
|
|
* [7.1. 接口是合約](ch7/ch7-01.md)
|
|
|
|
|
* [7.2. 接口類型](ch7/ch7-02.md)
|
|
|
|
|
* [7.3. 實現接口的條件](ch7/ch7-03.md)
|
|
|
|
|
* [7.4. flag.Value接口](ch7/ch7-04.md)
|
|
|
|
|
* [7.5. 接口值](ch7/ch7-05.md)
|
|
|
|
|
* [7.6. sort.Interface接口](ch7/ch7-06.md)
|
|
|
|
|
* [7.7. http.Handler接口](ch7/ch7-07.md)
|
|
|
|
|
* [7.8. error接口](ch7/ch7-08.md)
|
|
|
|
|
* [7.9. 示例: 表達式求值](ch7/ch7-09.md)
|
|
|
|
|
* [7.10. 類型斷言](ch7/ch7-10.md)
|
|
|
|
|
* [7.11. 基於類型斷言識别錯誤類型](ch7/ch7-11.md)
|
|
|
|
|
* [7.12. 通過類型斷言査詢接口](ch7/ch7-12.md)
|
|
|
|
|
* [7.13. 類型分支](ch7/ch7-13.md)
|
|
|
|
|
* [7.14. 示例: 基於標記的XML解碼](ch7/ch7-14.md)
|
|
|
|
|
* [7.15. 補充幾點](ch7/ch7-15.md)
|
|
|
|
|
* [第八章 Goroutines和Channels](ch8/ch8.md)
|
|
|
|
|
* [8.1. Goroutines](ch8/ch8-01.md)
|
2015-12-18 06:49:31 +00:00
|
|
|
|
* [8.2. 示例: 併發的Clock服務](ch8/ch8-02.md)
|
|
|
|
|
* [8.3. 示例: 併發的Echo服務](ch8/ch8-03.md)
|
2015-12-18 06:00:29 +00:00
|
|
|
|
* [8.4. Channels](ch8/ch8-04.md)
|
2015-12-18 06:49:31 +00:00
|
|
|
|
* [8.5. 併行的循環](ch8/ch8-05.md)
|
|
|
|
|
* [8.6. 示例: 併發的Web爬蟲](ch8/ch8-06.md)
|
|
|
|
|
* [8.7. 基於select的多路複用](ch8/ch8-07.md)
|
|
|
|
|
* [8.8. 示例: 併發的字典遍歷](ch8/ch8-08.md)
|
2015-12-26 12:05:30 +00:00
|
|
|
|
* [8.9. 併發的退出](ch8/ch8-09.md)
|
2015-12-18 06:00:29 +00:00
|
|
|
|
* [8.10. 示例: 聊天服務](ch8/ch8-10.md)
|
2015-12-18 06:49:31 +00:00
|
|
|
|
* [第九章 基於共享變量的併發](ch9/ch9.md)
|
2015-12-18 06:00:29 +00:00
|
|
|
|
* [9.1. 競爭條件](ch9/ch9-01.md)
|
|
|
|
|
* [9.2. sync.Mutex互斥鎖](ch9/ch9-02.md)
|
|
|
|
|
* [9.3. sync.RWMutex讀寫鎖](ch9/ch9-03.md)
|
|
|
|
|
* [9.4. 內存同步](ch9/ch9-04.md)
|
|
|
|
|
* [9.5. sync.Once初始化](ch9/ch9-05.md)
|
|
|
|
|
* [9.6. 競爭條件檢測](ch9/ch9-06.md)
|
2015-12-18 06:49:31 +00:00
|
|
|
|
* [9.7. 示例: 併發的非阻塞緩存](ch9/ch9-07.md)
|
|
|
|
|
* [9.8. Goroutines和線程](ch9/ch9-08.md)
|
2015-12-18 06:00:29 +00:00
|
|
|
|
* [第十章 包和工具](ch10/ch10.md)
|
|
|
|
|
* [10.1. 簡介](ch10/ch10-01.md)
|
|
|
|
|
* [10.2. 導入路徑](ch10/ch10-02.md)
|
|
|
|
|
* [10.3. 包聲明](ch10/ch10-03.md)
|
|
|
|
|
* [10.4. 導入聲明](ch10/ch10-04.md)
|
|
|
|
|
* [10.5. 匿名導入](ch10/ch10-05.md)
|
|
|
|
|
* [10.6. 包和命名](ch10/ch10-06.md)
|
|
|
|
|
* [10.7. 工具](ch10/ch10-07.md)
|
|
|
|
|
* [10.7.1. 工作區結構](ch10/ch10-07-1.md)
|
|
|
|
|
* [10.7.2. 下載包](ch10/ch10-07-2.md)
|
|
|
|
|
* [10.7.3. 構建包](ch10/ch10-07-3.md)
|
|
|
|
|
* [10.7.4. 包文檔](ch10/ch10-07-4.md)
|
|
|
|
|
* [10.7.5. 內部包](ch10/ch10-07-5.md)
|
|
|
|
|
* [10.7.6. 査詢包](ch10/ch10-07-6.md)
|
|
|
|
|
* [第十一章 測試](ch11/ch11.md)
|
|
|
|
|
* [11.1. go test](ch11/ch11-01.md)
|
|
|
|
|
* [11.2. 測試函數](ch11/ch11-02.md)
|
|
|
|
|
* [11.2.1. 隨機測試](ch11/ch11-02-1.md)
|
|
|
|
|
* [11.2.2. 測試一個命令](ch11/ch11-02-2.md)
|
|
|
|
|
* [11.2.3. 白盒測試](ch11/ch11-02-3.md)
|
|
|
|
|
* [11.2.4. 擴展測試包](ch11/ch11-02-4.md)
|
|
|
|
|
* [11.2.5. 編寫有效的測試](ch11/ch11-02-5.md)
|
|
|
|
|
* [11.2.6. 避免的不穩定的測試](ch11/ch11-02-6.md)
|
|
|
|
|
* [11.3. 測試覆蓋率](ch11/ch11-03.md)
|
|
|
|
|
* [11.4. 基準測試](ch11/ch11-04.md)
|
|
|
|
|
* [11.5. 剖析](ch11/ch11-05.md)
|
|
|
|
|
* [11.6. 示例函數](ch11/ch11-06.md)
|
|
|
|
|
* [第十二章 反射](ch12/ch12.md)
|
|
|
|
|
* [12.1. 爲何需要反射?](ch12/ch12-01.md)
|
|
|
|
|
* [12.2. reflect.Type和reflect.Value](ch12/ch12-02.md)
|
|
|
|
|
* [12.3. Display遞歸打印](ch12/ch12-03.md)
|
|
|
|
|
* [12.4. 示例: 編碼S表達式](ch12/ch12-04.md)
|
|
|
|
|
* [12.5. 通過reflect.Value脩改值](ch12/ch12-05.md)
|
|
|
|
|
* [12.6. 示例: 解碼S表達式](ch12/ch12-06.md)
|
2015-12-18 06:49:31 +00:00
|
|
|
|
* [12.7. 穫取結構體字段標識](ch12/ch12-07.md)
|
2015-12-18 06:00:29 +00:00
|
|
|
|
* [12.8. 顯示一個類型的方法集](ch12/ch12-08.md)
|
|
|
|
|
* [12.9. 幾點忠告](ch12/ch12-09.md)
|
|
|
|
|
* [第十三章 底層編程](ch13/ch13.md)
|
|
|
|
|
* [13.1. unsafe.Sizeof, Alignof 和 Offsetof](ch13/ch13-01.md)
|
|
|
|
|
* [13.2. unsafe.Pointer](ch13/ch13-02.md)
|
|
|
|
|
* [13.3. 示例: 深度相等判斷](ch13/ch13-03.md)
|
|
|
|
|
* [13.4. 通過cgo調用C代碼](ch13/ch13-04.md)
|
|
|
|
|
* [13.5. 幾點忠告](ch13/ch13-05.md)
|
2015-12-23 08:27:04 +00:00
|
|
|
|
* [附録](CONTRIBUTORS.md)
|
2015-12-18 06:00:29 +00:00
|
|
|
|
|