This project uses a set of developer tools to ensure code quality, maintainability, and consistency.
These tools are installed from ci/tools using go install.
In order to install the tools, run:
make install-toolsA comprehensive static analysis tool for Go. It catches bugs, performance issues, and style problems. Reference: https://staticcheck.dev/docs/
go install honnef.co/go/tools/cmd/staticcheckDetects ineffectual assignments in Go code — variables that are assigned but never used. Reference: https://github.com/gordonklaus/ineffassign
go install github.com/gordonklaus/ineffassignCalculates the cyclomatic complexity of Go functions, helping identify complex, hard-to-test code. Reference: https://github.com/fzipp/gocyclo
go install github.com/fzipp/gocyclo/cmd/gocycloChecks for common misspellings in code comments, documentation, and strings. Reference: https://github.com/client9/misspell
go install github.com/client9/misspell/cmd/misspellFormats Go code like gofmt but also adds or removes import lines as needed. Reference: https://pkg.go.dev/golang.org/x/tools/cmd/goimports
go install golang.org/x/tools/cmd/goimportsAutomatically adds license headers to source files. Reference: https://github.com/google/addlicense
go install github.com/google/addlicenseA fast, all-in-one Go linter that runs multiple linters in parallel. It aggregates the output of many popular static analysis tools. Reference: https://golangci-lint.run
Installation:
# binary will be $(go env GOPATH)/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.1.6
golangci-lint --versionTo run the linter, use:
make lintA BDD-style testing framework for Go that pairs well with Gomega. Reference: https://github.com/onsi/ginkgo
go install github.com/onsi/ginkgo/v2/ginkgoGenerates test doubles (fakes) from Go interfaces for unit tests. Reference: https://github.com/maxbrunsfeld/counterfeiter
go install github.com/maxbrunsfeld/counterfeiter/v6Generates Swagger/OpenAPI doc for Go HTTP APIs based on code annotations. Reference: https://github.com/swaggo/swag
go install github.com/swaggo/swag/cmd/swagGenerates Go code from .proto files with the Protocol Buffers compiler. Reference: https://pkg.go.dev/google.golang.org/protobuf/cmd/protoc-gen-go
go install google.golang.org/protobuf/cmd/protoc-gen-go