Use the same version as in the go.mod file.
go mod tidy
should be called before commit to add missing and remove unused modules.
Prior to commit all code should be formatted by the goimports tool.
Go to Preferences → Editor → Code style → Go → Imports → Sorting, choose "goimports".
- Call
go install golang.org/x/tools/cmd/goimports@latest
. - Install Golang extension.
- Go to Settings → Extensions → Format tool, choose "goimports".
See goimports doc.
We are using golangci-lint for static code analysis.
In case of Lint / lint
GitHub Action failure check the annotations on the PR’s Files changed
tab.
You could also run make lint
on your local env to check it.