October 2015
Beginner to intermediate
400 pages
14h 44m
English
Packages in Go serve the same purposes as libraries or modules
in other languages, supporting modularity, encapsulation, separate compilation,
and reuse. The source code for a package resides in one or more
.go files, usually in a directory whose name ends with the
import path; for instance, the files of the gopl.io/ch1/helloworld package are
stored in directory $GOPATH/src/gopl.io/ch1/helloworld.
Each package serves as a separate name space for its declarations.
Within the image package, for example, the identifier
Decode refers to a different function than does the same identifier
in the unicode/utf16 package.
To refer to a function from
outside its package, we must qualify the identifier to make explicit whether ...