HN2new | past | comments | ask | show | jobs | submitlogin

Of course you can, error is an interface, any number of concrete types can satisfy it, and you can use type assertions or type switches to unbox (and use) that concrete type.

This is a widely used idiom in Go.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: