This happened to me more than once, and not only with errors.

For a function that is declared to return an interface, if you return
a nil-pointer with a type other than that interface, the returned
interface is not nil.
Here's an example:

https://play.golang.org/p/dpd76zyN9Fv

I think go vet should warn about this case. What do you think?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAMV2RqrpdCa4t6VrBrkbU%3DrbdNhC_oz%2BusTD9PA6VgCb%3D2SXJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to