Skip to content

Commit

Permalink
Close output file
Browse files Browse the repository at this point in the history
  • Loading branch information
anjmao committed May 22, 2019
1 parent f008635 commit 01a8355
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"flag"
"go/token"
"go/types"
"golang.org/x/tools/go/packages"
"log"
"os"
"path/filepath"
Expand All @@ -13,6 +12,8 @@ import (
"text/template"
"unicode"
"unicode/utf8"

"golang.org/x/tools/go/packages"
)

type arrFlags []string
Expand Down Expand Up @@ -202,6 +203,7 @@ message {{.Name}} {
if err != nil {
return err
}
defer f.Close()

return tmpl.Execute(f, msgs)
}

0 comments on commit 01a8355

Please sign in to comment.