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.