On Sat, Jan 4, 2020 at 12:28 AM <ju...@sqreen.io> wrote: > > Hello, > > Is there any way to avoid the compilation error "*error is not a type" of > this example https://play.golang.org/p/gWNStGSCfTm ? > I understand the variable named `error` hides the type named `error` but is > there some other syntax to specify the error type?
No. In every scope a name binds to only one thing. Once a variable name in an inner scope hides a type name in an outer scope that type is no more accessible unless it's also aliased to a different name and that alias is not shadowed as well. -- 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/CAA40n-XhQeqORELwtxLWaTJq0N6s8AVJ_v6dP0W1FsrH4OChwA%40mail.gmail.com.