golint代码自测
1 安装golint
1.1 golang版本和golangci-lint版本需要对应:
官方版本对应描述如下:
go < 1.9 isn't supported
go1.9 is officially supported by golangci-lint <= v1.10.2
go1.10 is officially supported by golangci-lint <= 1.15.0.
go1.11 is officially supported by golangci-lint <= 1.17.1.
go1.12+ are officially supported by the latest version of golangci-lint (>= 1.18.0).
————————————————
1.2 找到自己golang对应版本https://github.com/golangci/golangci-lint/releases
file1.3 解压后将golangci-lint.exe
文件直接放到GOPATH\bin
目录下就可以直接使用了
file
2 Golint正确使用方式
官网推荐三种使用方式:
golangci-lint run
golangci-lint run ./...
这里...代表的就是检测目录下所有的文件
golangci-lint run dir1 dir2/... dir3/file1.go
本文由博客作者流雨声
github地址:https://github.com/vpc123
网友评论