diff --git a/generator/writer.go b/generator/writer.go index 56a0e58..c60e5f8 100644 --- a/generator/writer.go +++ b/generator/writer.go @@ -183,11 +183,14 @@ func Generate(p *compose.Parser, katernayVersion, appName, appVersion, composeFi default: fname := filepath.Join(templatesDir, n+"."+kind+".yaml") - fp, _ := os.Create(fname) + fp, err := os.Create(fname) + if err != nil { + log.Fatal(err) + } + defer fp.Close() enc := yaml.NewEncoder(fp) enc.SetIndent(2) enc.Encode(c) - fp.Close() } } }