Skip to content
bootstraponline edited this page Jul 18, 2017 · 6 revisions

Code quality

  • go fmt formats the code
  • golint identifies lint issues
  • errcheck identifies unchecked errors
  • honnef.co/go/tools/cmd/unused identifies unused code
  • honnef.co/go/tools/cmd/gosimple identifies code that can be simplified

Mocks & Testing

Code coverage

Print coverage

  • go test -cover

HTML coverage report

  • go test -coverprofile=coverage.out
  • go tool cover -html=coverage.out

Clone this wiki locally