链接中的代码行返回两个相应类型的值:。(Conn, error)if !p.Wait && p.MaxActive > 0 && p.active >= p.MaxActive { p.mu.Unlock() return errorConn{ErrPoolExhausted}, ErrPoolExhausted}类型是带有方法的接口。ConnErr// Err returns a non-nil value when the connection is not usable.Err() error因此,要获取基础错误,您可以:在第一个返回值上调用该方法;或Err检查第二个返回值。error作为旁注,比较错误的推荐方法是使用和/或来自标准库错误包。errors.Iserrors.As