diff --git a/cmd/pgen/gen.go b/cmd/pgen/gen.go index 62c9ed7..2e25d3c 100644 --- a/cmd/pgen/gen.go +++ b/cmd/pgen/gen.go @@ -122,7 +122,7 @@ func (g *Generator) Add(newName, typName, typ string) { subspec{regexp.MustCompile("_N"), typName}, subspec{regexp.MustCompile("_T"), typ}} - f, err := parser.ParseFile(g.fset, "", template, 0) + f, err := parser.ParseFile(g.fset, "", template, parser.ParseComments) if err != nil { log.Fatal("Parsing persist/template.T:",err) } diff --git a/cmd/pgen/template.go b/cmd/pgen/template.go index 048cac0..34d499a 100644 --- a/cmd/pgen/template.go +++ b/cmd/pgen/template.go @@ -1,5 +1,7 @@ package main -const template string = `package main +const template string = `//Generated by gitlab.wow.st/persist/cmd/pgen. +//Do not edit +package main import ( "encoding/gob"