From b4fbd3d6d60a4c741f49b015e048e378009f0986 Mon Sep 17 00:00:00 2001 From: Janet Kuo Date: Thu, 7 Jul 2016 11:36:44 -0700 Subject: [PATCH] Fix the 'failed to write to file' error when --out is set --- cli/app/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/app/app.go b/cli/app/app.go index 75668b5eb..d57f2afd3 100644 --- a/cli/app/app.go +++ b/cli/app/app.go @@ -254,7 +254,6 @@ func createOutFile(out string) *os.File { if err != nil { logrus.Fatalf("error opening file: %v", err) } - defer f.Close() } return f } @@ -595,6 +594,7 @@ func ProjectKuberConvert(p *project.Project, c *cli.Context) { } f := createOutFile(outFile) + defer f.Close() var mServices map[string]api.Service = make(map[string]api.Service) var serviceLinks []string