内置gofmt

go fmt ./...

golangci-lint

官网

# go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
golangci-lint run

nilaway

github

# go install go.uber.org/nilaway/cmd/nilaway@latest
nilaway ./...