本文永久链接 - https://tonybai.com/2023/05/14/a-guide-of-using-go-error-chain 0. Go错误处理简要回顾 Go是一种非常强调错误处理的编程语言。在Go中,错误被表示为实现了error接口的类型的值,error接口只有| tonybai.com
本文永久链接 - https://tonybai.com/2023/02/19/how-to-determine-if-two-interface-vars-are-equal 近日一位《Go语言第一课》专栏的读者向我提出一个问题,代码如下: func main() { printNonEmptyInterfa| tonybai.com
介绍 在过去的十年中, Go的errors are values的理念在编码实践中运行得也很良好。尽管标准库对错误处理的的支持很少(只有errors.New和fmt.Errorf函数可以用来构造仅包含字符串消息的错误),但是内置的error接口| tonybai.com
这几年关于Go语言未来演化的讨论成为了Gopher世界的热点,Go team官方对于Go语言的演化(以Go2为标签)也是十分上心,但吸取了其他语言,比如:Python3割裂社区的、不兼容演化的教训,Go team最终选择了一条尽可能地兼| tonybai.com
Simplicity is Complicated| go.dev
本文永久链接 - https://tonybai.com/2025/02/05/go-encoding-json-v2-proposal-json-processing-new-engine Go标准库中的encoding/json包,作为Go社区广泛使用的JSON处理工具,至今已走过十余年。凭借其将JSON数| tonybai.com
This is a discussion about a new syntax that may be used to handle errors. This is issue #71203 converted into a discussion. I've written a tool that converts ordinary Go code into code that uses t...| GitHub