understand
"error values returned from functions should be opaque to the caller"
philosophy.
But I don't like sample code in the post:
func isTimeout(err error) bool {
type timeout interface {
Timeout() bool
}
if te, ok := err.(timeout); ok {
return te.Timeout()
}
return false
}
If `Timeout() bool` and `Temporary() bool` is so common, why they are not
in errors package?
I know `net.Error` interface. It includes both of Timeout and Temporary.
Is it good to use `net.Error` for investigating error value returned from
package other than net?
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.