in dev-tools/mage/fmt.go [45:64]
func (GoImports) Run() error {
mg.Deps(GoImports.Install)
goFiles, err := FindFilesRecursive(func(path string, _ os.FileInfo) bool {
return filepath.Ext(path) == ".go"
})
if err != nil {
return err
}
if len(goFiles) == 0 {
return nil
}
fmt.Println(">> fmt - goimports: Formatting Go code") //nolint:forbidigo // it's a mage target
args := append(
[]string{"-local", GoImportsLocalPrefix, "-l", "-w"},
goFiles...,
)
return sh.RunV("goimports", args...)
}