Go 中这么多创建 error 的方式,你真的了解它们各自的应用场景吗
大家好,我是渔夫子。今天从应用场景的角度来聊聊我对 error 的理解。

原文链接: https://mp.weixin.qq.com/s/ncEemMJ0kQayVPJrnF9aew

01 什么是 Error

在 Go 中,error 是一种内建的数据类型。在 Go 中被定义为一个接口,定义如下:


<span class="c">// The error built-in interface type is the conventional interface for< ... ⌘ [Read more](https://gocn.vip/topics/20911)

⤋ Read More