Cheatsheet for golang

less than 1 minute read

Run tests

go test ./... # run all tests in current directory and all of its sub-directories
go test ./a/... ./b/... # run tests for some particular directories
go test ... # run all tests in your $GOPATH

Specify default values for json parsing

  • https://stackoverflow.com/questions/30445479/how-to-specify-default-values-when-parsing-json-in-go

Tools

Updated:

Comments