k3s/vendor/github.com/rancher/wrangler/pkg/cleanup/cleanup.go
Darren Shepherd 16f7aaab66 Update vendor
2019-05-25 23:44:33 -07:00

32 lines
491 B
Go

package cleanup
import (
"fmt"
"os"
"path/filepath"
"strings"
)
func Cleanup(path string) error {
return filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
fmt.Println(path)
if err != nil {
return err
}
if strings.Contains(path, "vendor") {
return filepath.SkipDir
}
if strings.HasPrefix(info.Name(), "zz_generated") {
fmt.Println("Removing", path)
if err := os.Remove(path); err != nil {
return err
}
}
return nil
})
}