Curriculum Errors & packaging Packages & imports exercise 2 · mcq
Packages & imports
The capitalisation rule is Go's entire export mechanism.
Pick the statement that is TRUE about Go identifier visibility.
TypeScript uses export keywords + default markers; Go uses
the first letter of the name. Mechanical, irreversible — you
can't have a capitalised-but-package-private identifier.
TypeScript reference
About this theme
Every file declares a package: package foo. Names starting with a capital letter are exported; lowercase are package-private. This rule is mechanical and pervasive; once you internalise it, you stop needing to look at export keywords because there aren't any. Imports go in a single import (...) block.