refactor: update variable names and improve code readability; add Makefile for linting and installation

This commit is contained in:
Laisky.Cai
2025-01-23 03:32:41 +00:00
parent 81153f764b
commit 531f832d1e
12 changed files with 659 additions and 60 deletions

19
Makefile Normal file
View File

@@ -0,0 +1,19 @@
.PHONY: install
install:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/vuln/cmd/govulncheck@latest
# go install go.uber.org/nilaway/cmd/nilaway@latest
# go install github.com/mitranim/gow@latest
# go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
# go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
.PHONY: lint
lint:
# goimports -local module github.com/songquanpeng/one-api -w .
go mod tidy
gofmt -s -w .
go vet
# nilaway ./...
golangci-lint run -c .golangci.lint.yml
govulncheck ./...