1 Star 0 Fork 0

go-better/go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
func.go 605 Bytes
一键复制 编辑 原始数据 按行查看 历史
bughou 提交于 2022-03-21 20:37 +08:00 . save
package funcpkg
import (
"go/ast"
"go/token"
namepkg "gitee.com/go-better/dev/tool/gospec/rules/name"
)
var Func = Rule{
key: "func",
Name: namepkg.Rule{
MaxLen: 30, Style: "camelCase",
},
Size: sizeRule{
MaxParams: 5, MaxResults: 3, MaxStatements: 30,
},
}
var FuncInTest = Rule{
key: "funcInTest",
Name: namepkg.Rule{
MaxLen: 50, Style: "camelCase",
},
Size: sizeRule{
MaxParams: 5, MaxResults: 3, MaxStatements: 30,
},
}
func Check(isTest bool, node ast.Node, fileSet *token.FileSet) {
if isTest {
FuncInTest.Check(node, fileSet)
} else {
Func.Check(node, fileSet)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/go-better/go.git
git@gitee.com:go-better/go.git
go-better
go
go
d31700df43a9

搜索帮助