nurse/magefiles/format.go
Peter 59d2d26984
All checks were successful
concourse-ci/golangci-lint golangci-lint run
concourse-ci/gotestsum gotestsum
feat: add concourse pipeline
2022-12-30 21:41:30 +01:00

30 lines
547 B
Go

package main
import (
"github.com/magefile/mage/mg"
"github.com/magefile/mage/sh"
)
func Format() {
mg.Deps(GoImports, GoFumpt)
}
func GoImports() error {
if err := ensureGoTool("goimports", "golang.org/x/tools/cmd/goimports", "latest"); err != nil {
return err
}
return sh.RunV(
"goimports",
"-local=inetmock.icb4dc0.de/inetmock",
"-w",
WorkingDir,
)
}
func GoFumpt() error {
if err := ensureGoTool("gofumpt", "mvdan.cc/gofumpt", "latest"); err != nil {
return err
}
return sh.RunV("gofumpt", "-l", "-w", WorkingDir)
}