Bug fix in gen.go: do not try to write if there is no output.
This commit is contained in:
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user