golint的简易使用方法


当前第2页 返回上一页

1

2

3

4

import-dot.go:6:8: should not use dot imports

else.go:11:9: if block ends with a return statement, so drop this else and outdent its block

sort.go:11:1: exported method T.Len should have comment or be unexported

sort.go:20:1: exported method U.Other should have comment or be unexported

从上面输出可以看到,golint对go代码给出的建议。

golint 会检查的内容:

变量名规范

变量的声明,像var str string = "test",会有警告,应该var str = "test"

大小写问题,大写导出包的要有注释

x += 1 应该 x++

更多golang开发知识请关注PHP中文网golang教程栏目。

以上就是golint的简易使用方法的详细内容,更多文章请关注木庄网络博客!!

返回前面的内容

相关阅读 >>

Golang elasticsearch7的使用

Go 内嵌静态资源

Go基础及语法(四)

以大见小 - rust快速实践(一)

Go-zero 如何扛住流量冲击(一)

关于 Golang 字符串 格式化

[concurrent-map]-并发map在Go中的使用

Go-carbon1.3.3版本发布了

通过协程查找数组中元素

protoc Go插件编写之四 (实现生成自己的proto文件)

更多相关阅读请进入《Go》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...