You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that the provided example doesn't compile, because that's not shadowing but trying to redeclare. And if it had worked, it would've been an unused variable and also hadn't compiled.
Do you have a closer-to-reality example you'd like to see flagged by Staticcheck?
staticcheck
should detect the shadowing of named returns.In the following example, the function
foo()
uses the named returnerr error
. In this case, the named return is shadowed byerr := bar()
.The text was updated successfully, but these errors were encountered: