在好例子网,分享、交流、成长!
您当前所在位置:首页Go 开发实例Go语言基础 → The Go Programming Language(《Go语言圣经》)

The Go Programming Language(《Go语言圣经》)

Go语言基础

下载此实例
  • 开发语言:Go
  • 实例大小:5.06M
  • 下载次数:7
  • 浏览次数:32
  • 发布时间:2022-11-07
  • 实例类别:Go语言基础
  • 发 布 人:hsdjl
  • 文件格式:.pdf
  • 所需积分:2
 相关标签: Programming Language Pro AM go

实例介绍

【实例简介】The Go Programming Language(《Go语言圣经》)

【实例截图】

【核心代码】

Cont ents
Pr eface xi
The Origins of Go xii
The Go Pro jec t xiii
Organizat ion of the Book xv
Wh ere to Find More Infor mat ion xvi
Ac knowledgments xvii
1. Tutorial 1
1.1. Hel lo, Wor ld 1
1.2. Command-L ine Arguments 4
1.3. Finding Dup lic ate Lines 8
1.4. Animated GIFs 13
1.5. Fetching a URL 15
1.6. Fetching URLs Con cur rently 17
1.7. A We b Server 19
1.8. Loose End s 23
2. Pro gram Str ucture 27
2.1. Names 27
2.2. Declarat ions 28
2.3. Var iables 30
2.4. Assig nments 36
2.5. Typ e Decl arat ions 39
2.6. Packages and Files 41
2.7. Scope 45
vii
viii CONTENTS
3. Basic Data Typ es 51
3.1. Int egers 51
3.2. Float ing-Point Numbers 56
3.3. Complex Numbers 61
3.4. Boole ans 63
3.5. Str ings 64
3.6. Con stants 75
4. Com posite Typ es 81
4.1. Arrays 81
4.2. Slices 84
4.3. Maps 93
4.4. Str ucts 99
4.5. JSON 107
4.6. Text and HTML Templ ates 113
5. Func tions 119
5.1. Function Declarat ions 119
5.2. Rec ursion 121
5.3. Multiple Retur n Values 124
5.4. Erro rs 127
5.5. Function Values 132
5.6. Anony mou s Func tions 135
5.7. Var iadic Functions 142
5.8. Defer red Function Cal ls 143
5.9. Panic 148
5.10. Recov er 151
6. Metho ds 155
6.1. Met hod Declarat ions 155
6.2. Met hods wit h a Point er Receiver 158
6.3. Composing Typ es by Str uct Emb edding 161
6.4. Met hod Values and Expressions 164
6.5. Example: Bit Vec tor Typ e 165
6.6. Encapsulat ion 168
7. Interfaces 171
7.1. Int erfaces as Contrac ts 171
7.2. Int erface Typ es 174
7.3. Int erface Satisfac tion 175
7.4. Parsing Flags wit h flag.Value 179
7.5. Int erface Values 181
CONTENTS ix
7.6. Sor ting wit h sort.Interface 186
7.7. The http.Handler Interface 191
7.8. The error Interface 196
7.9. Example: Expression Evaluator 197
7.10. Typ e As ser tions 205
7.11. Discriminat ing Error s with Typ e As ser tions 206
7.12. Quer ying Beh avior s with Int erface Typ e As ser tions 208
7.13. Typ e Sw itch es 210
7.14. Example: Token-B ased XML Decoding 213
7.15. A Fe w Wo rds of Adv ice 216
8. Gor o utines and Channels 217
8.1. Goroutines 217
8.2. Example: Con cur rent Clo ck Ser ver 219
8.3. Example: Con cur rent Ech o Server 222
8.4. Channel s 225
8.5. Looping in Paral lel 234
8.6. Example: Con cur rent Web Craw ler 239
8.7. Multiplexing wit h select 244
8.8. Example: Con cur rent Direc tor y Traversal 247
8.9. Cancellat ion 251
8.10. Example: Chat Ser ver 253
9. Concurrency with Shared Vari ables 257
9.1. Race Con dit ion s 257
9.2. Mut ual Exc lusion: sync.Mutex 262
9.3. Read/Write Mut exes: sync.RWMutex 266
9.4. Memor y Sy nchro nizat ion 267
9.5. Lazy Initializat ion: sync.Once 268
9.6. The Race Detec tor 271
9.7. Example: Con cur rent Non-Blo cking Cache 272
9.8. Goroutines and Threads 280
10. Pack ages and the Go Tool 283
10.1. Int roduc tion 283
10.2. Imp ort Pat hs 284
10.3. The Package Declarat ion 285
10.4. Imp ort Declarat ions 285
10.5. Blank Imp orts 286
10.6. Packages and Naming 289
10.7. The Go Tool 290
x CONTENTS
11. Testing 301
11.1. The go test To ol 302
11.2. Test Func tions 302
11.3. Cov erage 318
11.4. Benchmark Func tions 321
11.5. Profiling 323
11.6. Example Func tions 326
12. Reflecti on 329
12.1. Why Reflec tion? 329
12.2. reflect.Type and reflect.Value 330
12.3. Display , a Rec ursive Value Print er 333
12.4. Example: Enco ding S-E xpressions 338
12.5. Setting Var iables wit h reflect.Value 341
12.6. Example: Decoding S-E xpressions 344
12.7. Accessing Str uct Field Tags 348
12.8. Displaying the Met hods of a Typ e 351
12.9. A Wo rd of Caution 352
13. Low-L evel Pro gramming 353
13.1. unsafe.Sizeof , Alignof , and Offsetof 354
13.2. unsafe.Pointer 356
13.3. Example: Deep Equivalence 358
13.4. Cal ling C Code wit h cgo 361
13.5. Another Word of Caution 366
Index 367
Pref ace

实例下载地址

The Go Programming Language(《Go语言圣经》)

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
;
报警