在好例子网,分享、交流、成长!
您当前所在位置:首页Go 开发实例Go语言基础 → Go语言经典开发.pdf

Go语言经典开发.pdf

Go语言基础

下载此实例
  • 开发语言:Go
  • 实例大小:6.51M
  • 下载次数:31
  • 浏览次数:180
  • 发布时间:2020-10-10
  • 实例类别:Go语言基础
  • 发 布 人:timepower001
  • 文件格式:.pdf
  • 所需积分:2
 相关标签: Go语言 go 经典 开发 语言

实例介绍

【实例简介】The.Go.Programming.Language.2015.11.pdf

【实例截图】

【核心代码】

Contents
Preface xi
The Origins of Go xii
The Go Project xiii
Organizat ion of the Book xv
Wh ere to Find More Infor mat ion xvi
Ac knowledgments xvii
1. Tutorial 1
1.1. Hello, Wor ld 1
1.2. Command-L ine Arguments 4
1.3. Finding Duplicate Lines 8
1.4. Animated GIFs 13
1.5. FetchingaURL 15
1.6. Fetching URLs Concurrently 17
1.7. A Web Server 19
1.8. Loose End s 23
2. Program Structure 27
2.1. Names 27
2.2. Declarations 28
2.3. Variables 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
The Go Programming Language
© 2016 Alan A. A. Donovan & Brian W. Kernighan
revision 3b600c, date 29 Sep 2015
From the Library of YIGUANG HU
ptg16105617
viii CONTENTS
3. Basic Data Typ es 51
3.1. Integers 51
3.2. Floating-Point Numbers 56
3.3. Complex Numbers 61
3.4. Booleans 63
3.5. Strings 64
3.6. Constants 75
4. Composite 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 Return Values 124
5.4. Errors 127
5.5. Function Values 132
5.6. Anonymous Func tions 135
5.7. Variadic Functions 142
5.8. Deferred Function Cal ls 143
5.9. Panic 148
5.10. Recov er 151
6. Methods 155
6.1. Method Declarations 155
6.2. Methods with a Pointer Receiver 158
6.3. Composing Types by Struct Emb edding 161
6.4. Method Values and Expressions 164
6.5. Example: Bit Vector Type 165
6.6. Encapsulation 168
7. Interfaces 171
7.1. Interfaces as Contracts 171
7.2. Int erface Types 174
7.3. Int erface Satisfac tion 175
7.4. Parsing Flags wit h flag.Value 179
7.5. Int erface Values 181
The Go Programming Language
© 2016 Alan A. A. Donovan & Brian W. Kernighan
revision 3b600c, date 29 Sep 2015
From the Library of YIGUANG HU
ptg16105617
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
The Go Programming Language
© 2016 Alan A. A. Donovan & Brian W. Kernighan
revision 3b600c, date 29 Sep 2015
From the Library of YIGUANG HU
ptg16105617
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,aRec 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 lingCCode wit h cgo 361
13.5. Another Word of Caution 366
Index 367

实例下载地址

Go语言经典开发.pdf

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

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

网友评论

发表评论

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

查看所有0条评论>>

小贴士

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

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

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警