goconst:在Go中查找可以被常量替换的重复字符串

时间:2021-05-08 16:51:22
【文件属性】:
文件名称:goconst:在Go中查找可以被常量替换的重复字符串
文件大小:9KB
文件格式:ZIP
更新时间:2021-05-08 16:51:22
go linter Go Goconst 查找可以用常量替换的重复字符串。 动机 使用常量而不是重复字符串有明显的好处,主要是为了简化维护。 不能反对更改单个常量或多个字符串。 虽然这可能被认为是初学者的错误,但随着时间的流逝,会出现多个程序包和大型代码库,但有些重复可能会出现。 开始使用 $ go get github.com/jgautheron/goconst/cmd/goconst $ goconst ./... 用法 Usage: goconst ARGS Flags: -ignore exclude files matching the given regular expression -ignore-tests exclude tests from the search (default: true) -min-occurre
【文件预览】:
goconst-master
----go.mod(46B)
----visitor.go(4KB)
----LICENSE(1KB)
----README.md(2KB)
----tests()
--------main.go(480B)
--------foo_test.go(184B)
----parser.go(4KB)
----api.go(1KB)
----cmd()
--------goconst()

网友评论