typeover
curriculum

Curriculum Errors & packaging Packages & imports exercise 1 · mcq

Packages & imports

Every Go file starts with a package declaration. Pick the line that declares this file as belonging to the main package — the convention for an executable's entry-point file. TypeScript doesn't have a package declaration concept (modules are file-based); Go's package line is mandatory and is the first non-comment line in every file.

TypeScript reference
Pick the idiomatic Go translation

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.