错误处理规范:创建、包装与终结处理
Go 的错误处理没有语言级机制介入:没有异常,没有堆栈自动展开,error 就是实现了 Error() string 接口的普通值,随函数返回值逐层传递。这一设计使控制流显式可见,代价是"如何处理错误"完全依赖工程约定。
10 min read
Loading…
Quote of the day · October 26 · 关于意义 · Rick and Morty
Nobody exists on purpose. Nobody belongs anywhere. Everybody's gonna die. Come watch TV?
Notes on Agent runtimes — design decisions laid open: why it is this way, what it costs, and when it stops being true.