The Go CLI Playbook Flashcards
How many programs do you need to develop in go?
Only one: go cli
How to get help on a specific command?
go help
How to run a single go file? What are the two things it requires to run?
go run .
Requires a func main() and all dependencies needs to be acessible.
What is the effect of the go build command in a module and in the main file?
Only compiles the module. Builds and generates an executable.
Where is the binary saved by default?
In the working dir
what command runs tests? does it support defining specific names with wildcards such as *?
go test -run ./Module*
yes
How to print the go environment variables? How to print in json format?
go env
go env -json
how to add a package to the module? Should you add the url schema to it (e.g: https)? What is the most common form?
go get github.com/nathan-osman/go-sunrise
NO
go install github.com/nathan-osman/go-sunrise