Why does (*Client) Do() from net/http return error instead of *url.Error?

160 views Asked by At

The documentation for the Do method of the http client of net/http in Golang says that “Any returned error will be of type *url.Error.” Why is the return type error then? Doesn’t this just require users to do a type check to get information from the underlying error that is guaranteed to always be there?

0

There are 0 answers