Add golangci mage target
This commit is contained in:
parent
d56a611be7
commit
8bbdab7cfa
10
magefile.go
10
magefile.go
|
@ -434,6 +434,16 @@ func (Check) Goconst() {
|
||||||
runAndStreamOutput("goconst", ApiPackages...)
|
runAndStreamOutput("goconst", ApiPackages...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (Check) Golangci() {
|
||||||
|
mg.Deps(initVars)
|
||||||
|
if err := exec.Command("golangci-lint").Run(); err != nil && strings.Contains(err.Error(), "executable file not found") {
|
||||||
|
fmt.Println("Please manually install golangci-lint by running")
|
||||||
|
fmt.Println("curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.31.0")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
runAndStreamOutput("golangci-lint", "run")
|
||||||
|
}
|
||||||
|
|
||||||
// Runs fmt-check, lint, got-swag, misspell-check, ineffasign-check, gocyclo-check, static-check, gosec-check, goconst-check all in parallel
|
// Runs fmt-check, lint, got-swag, misspell-check, ineffasign-check, gocyclo-check, static-check, gosec-check, goconst-check all in parallel
|
||||||
func (Check) All() {
|
func (Check) All() {
|
||||||
mg.Deps(initVars)
|
mg.Deps(initVars)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user