Back to Developer Roadmap

Scope and Shadowing

src/data/roadmaps/golang/content/[email protected]

4.0501 B
Original Source

Scope and Shadowing

Scope determines variable accessibility from universe to block level. Shadowing occurs when inner scope variables hide outer ones with same names. Go has package, function, and block scopes. Understanding prevents bugs from accidentally creating new variables.

Visit the following resources to learn more: