Curriculum Errors & packaging Packages & imports
Packages & imports
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.
9 ready
01
pick one Every Go file starts with a package declaration. Pick the
02
pick oneThe capitalisation rule is Go's entire export mechanism.
03
pick oneMulti-package imports use the grouped import block form.
04
fill blanksType the keyword that declares this file's package. The file
05
fill blanksType the keyword that begins the grouped import block. The
06
type one line The scaffold imports fmt and strings. Write the FULL
07
type one line Type the call to strings.Repeat that produces abcabcabc
08
write a programBuild a small program demonstrating the package + import +
09
write a programTheme 5.4 capstone — pull together package, import,