Bug fix in gen.go: do not try to write if there is no output.

This commit is contained in:
Greg 2018-08-03 16:39:01 -04:00
parent 56ab75dcc2
commit 0d662564aa

View File

@ -131,6 +131,9 @@ func newImportSpec(name string) *ast.ImportSpec {
} }
func gen(wantImps []string) { func gen(wantImps []string) {
if nodes == nil {
return
}
of, err := os.Create("pgen.go") of, err := os.Create("pgen.go")
if err != nil { if err != nil {
log.Fatal("Cannot open pgen.go") log.Fatal("Cannot open pgen.go")