9

gofmt、lint插件格式化go代码

 2 years ago
source link: http://www.lzhpo.com/article/143
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

gofmt、lint插件格式化go代码

gofmt

这个是代码格式化的。

命令行使用:

gofmt -w .

类似于前端的那种es-lint,代码检查的。

下载地址:https://github.com/golangci/golangci-lint/releases

我Windows下载的是这个版本:golangci-lint-1.30.0-windows-amd64.zip

golangci-lint-下载.png

golangci-lint-配置环境变量.png

# 查看版本golangci-lint --version
golangci-lint run
golangci-lint run [目录]/[文件名]
正文到此结束
所属分类:Go开发

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK