typeover
curriculum

Curriculum Errors & packaging Packages & imports exercise 3 · mcq

Packages & imports

Multi-package imports use the grouped import block form. Pick the idiomatic shape for importing fmt and strings. TS uses one import line per source. Go's idiom for 2+ imports is a parenthesised block — gofmt enforces it, and the tooling sorts the entries alphabetically inside the block.

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.