diff --git a/main.go b/main.go index 6aa8f47..7ab05aa 100644 --- a/main.go +++ b/main.go @@ -75,7 +75,7 @@ type apiPackage struct { func (v *apiPackage) identifier() string { return fmt.Sprintf("%s/%s", v.apiGroup, v.apiVersion) } -func init() { +func initFlags() { klog.InitFlags(nil) flag.Set("alsologtostderr", "true") // for klog flag.Parse() @@ -114,6 +114,8 @@ func resolveTemplateDir(dir string) error { func main() { defer klog.Flush() + initFlags() + f, err := os.Open(*flConfig) if err != nil { klog.Fatalf("failed to open config file: %+v", err)