Parse comments in the template and write them to the output files.
This commit is contained in:
parent
bc06994bcf
commit
62c409292b
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user