Go
跳转到导航
跳转到搜索
技巧
TLS 抓包解密
w := os.Stdout
client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
KeyLogWriter: w,
},
},
}
resp, _ := client.Get(URL)
容易出问题的地方
语法
- Chris's Wiki :: Sorting out slice mutability in Go: 关于
append
奇怪的语法 - Chris's Wiki :: Learning about Go's unaddressable values and slicing, Chris's Wiki :: Addressable values in Go (and unaddressable ones too)
- Notes on structured concurrency, or: Go statement considered harmful — njs blog
- Golang is Trash 伪汇编
- Golang Panic 行为探秘, The Right Places to Call the recover Function:
recover()
的复杂性 - Fix issue #742 (#745) · miekg/dns@501e858: 奇特的 shadowing 规则 + nil interface value
- 5 Common Golang Coding Mistakes To Avoid | by Tuan Nhu Dinh | Jul, 2021 | Better Programming
- Fix roomserver deadlock by richvdh · Pull Request #380 · matrix-org/dendrite: 不要在循环中使用
defer
运行时与库
- Chris's Wiki :: Trailing text, a subtle gotcha with Go's fmt.Sscanf:
fmt.Sscanf
不能区分多余的字符 - Go, don't collect my garbage: 做纯计算时,gc overhead 很大
- Golang's Garbage | USENIX (关于垃圾回收)
Context
- 令人迷惑的 context - laike9m's blog: context 同时做数据存储和 goroutine 通信
- Context should go away for Go 2 — faiface blog
- time
- Chris's Wiki :: A small irritation with Go's crypto/tls package
- Why Discord is switching from Go to Rust - Discord Blog
- Golang中使用defer时注意io缓冲区刷新问题 :: /dev/ttyS3 — 回首向来萧瑟处 也无荒野也无灯
- netaddr.IP: a new IP address type for Go · Tailscale: Go 自带的 IP 类型竟然是可动态扩容的字节数组,并且不支持相等性判断
- Chris's Wiki :: Go 1.21 may have a clear(x) builtin and there's an interesting reason why: NaN 作为 map 的 key 引发的语言上的修改
文件名约定
- realityone on Twitter: "曾经有一个项目其中一个文件名结尾是 _js.go,有一天这个项目突然无法编译了… "
- runtime: add missing build constraints to os_linux_{be64,noauxv,novds… · golang/go@083f395: Go 自己被自己坑的例子
外部链接
- 从 Go 的二进制文件中获取其依赖的模块信息 | MoeLove
- Hooking Go from Rust - Hitchhiker’s Guide to the Go-laxy MetalBear 🐻
库下载代理
- Goproxy 中国: 使用七牛 CDN
- GOPROXY.IO - 一个全球代理 为 Go 模块而生: 使用香港腾讯云
对比
批评
- Chris's Wiki :: An example of a situation where Go interfaces can't substitute for generics
- Chris's Wiki :: Go is Google's language, not ours
- 对 Go 语言的综合评价 (王垠,2014-04-18) 存档
- 我为什么放弃Go语言 - liigo's blog - 博客频道 - CSDN.NET 语言特性及社区
- 为什么Go语言不是想象中的那么好 | 程序师
- Why Go Is Not Good :: Will Yager 各种语言特性
- Chris's Wiki :: What sysadmins want out of logging means that it can't be too simple: 关于程序中的日志记录
- D语言架构师Andrei Alexandrescu谈D、Go、Rust取代C/C++ 效率、社区政治、抽象表达能力差
- Tikhon Jelvis's answer to whether Go was the most modern and well-featured programming language 很有趣的评论
- Adam Leventhal's blog » I Love Go; I Hate Go
- Go: the Good, the Bad and the Ugly
- Go concurrency considered harmful – Sargun Dhillon – Medium
- 再说Go语言 | 桃子的博客志
- > The bulk of my trust is consolidated in the Go project, and thanks to their st... | Hacker News
- Abstracting away correctness - fasterthanli.me: 关于 API 设计
- I want off Mr. Golang's Wild Ride - fasterthanli.me: Go 的表面简单背后隐藏了欺骗和复杂性,给使用带来了更多的复杂性。
- Lies we tell ourselves to keep using Golang
- Go is not an easy language