- go build compile package and dependencies
- go clean remove object files and cached files
- go get add dependencies to current module and install them
- go install compile and install packages and dependencies
- go list list packages or modules
- go run compile and run Go program.
- go test test packages
- go version print go version
- go fmt gofmt (reformat) package sources
For a completed list of commands. Please check here.
- The visibility of a name outside a package is determined by whether its first character is upper case.
- Prefer simple name instead of a long name.
- Package name should be good: short, concise, evocative. By convention, packages are given lower case, single-word names; there should be no need for underscores or mixedCaps.
- The package name is the base name of its source directory; the package in src/encoding/base64 is imported as "encoding/base64" but has name base64,
- Go doesn't provide automatic support for getters and setters. Use
Owneras an example, the getter method should be called
Owner(upper case, exported), not
GetOwner. A setter function, if needed, will likely be called
- By convention, one-method interfaces are named by the method name plus an -er suffix or similar modification to construct an agent noun: Reader, Writer, Formatter, CloseNotifier etc.
- The convention in Go is to use
mixedCapsrather than underscores to write multiword names.