func Unwrap(err error) error {
// what is the meaning of this code
u, ok := err.(interface {
Unwrap() error
})
if !ok {
return nil
}
return u.Unwrap()
这是来自错误pkg的源代码,
我想知道它的用法是什么
err.(interface {})
ABOUTYOU
守着一只汪
相关分类