Michael Crosby

Go Helpful Commands

Here are a few go commands that I find helpful that are hidden in documentation.

List all installed packages

go list all

Build entire pkg directory

go build . ./...

Install entire pkg directory

go install . ./...

Test entire pkg

go test . ./...

Format and simplify code

go fmt -s -w <file>

Detect races

go test -race .

comments powered by Disqus