golint---golang代码质量检测
发布时间:2020-12-16 18:55:59 所属栏目:大数据 来源:网络整理
导读:github: https://github.com/golang/lint golint是类似javascript中的jslint的工具,主要功能就是检测代码中不规范的地方。golint用于检测go代码。 使用 $ go get github.com/golang/lint$ go install github.com/golang/lint golint 文件名或者目录 检测对
github: https://github.com/golang/lint golint是类似javascript中的jslint的工具,主要功能就是检测代码中不规范的地方。golint用于检测go代码。 使用$ go get github.com/golang/lint $ go install github.com/golang/lint
golint会输出一些代码存在的问题: recorder.go:55:5: exported var RecordBind should have comment or be unexported recorder.go:158:1: exported function Record_ErrorRecord should have comment or be unexported recorder.go:173:6: don't use underscores in Go names; type Data_MemStats should be DataMemStats recorder.go:179:2: struct field FreeRam should be FreeRAM 上面的输出中文件recorder.go,179行,在struct中字段 golint 会检测的方面:
等等 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |