Gowithtests

Goland refactor

  • CMD+OPTION+M -> extract method
  • CMD+OPTION+R -> refactor menu
  • CMD+OPTION+B -> go to declaration

Go Docs

to serve the docs with the current project's examples and documentation

godoc -http=:6060

to get the docs about a function

go doc fmt.Println

Benchmark

go test -v -bench=. ./...

Coverage

go test -cover ./...

Build without debug and symbol table

go build -ldflags "-w -s"

Build for multiple OS and Arch

GOOS="linux" GOARCH="amd64" go build hello.go

Errors

go install github.com/kisielk/errcheck@latest
#single directory
errcheck .
#recursive 
# todo bash script running errcheck recursively