golint错误检查以及 min-confidence 不同等级的错误提示
未指出 min-confidence 在不同等级有不同区别的提示,默认都是严格显示的。当 mini-confidence 大于 1 时,所有错误都会被接受。
-
exported type T should have comment or be unexported
要暴露出去的结构体或者函数都应该写注释。
-
comment on exported type U should be of the form "U …"
定义的type要被使用,对函数或者type写注释,注释要以函数名或type名字开头。 在以 "_test.go" 结尾的文件,不应该要求写注释
eg:
// H is a type. type H int
-
a blank import should be only in a main or test package, or have a comment justifying it
import 时要使用 '_' 时,要写注释。在 main package 或者测试文件中不需要写注释。
-
exported const Whatsit should have comment (or a comment on this block) or be unexported
const 模块要添加注释。
-
context.Context should be the first parameter of a function
context 参数要放在函数参数的第一个, 当 min-confidence 大于 0.9 时会忽略, 小于等于0.9会显示。
-
should not use basic type string as key in co