summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--generateHeader.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/generateHeader.go b/generateHeader.go
index 0a6ae43..274a571 100644
--- a/generateHeader.go
+++ b/generateHeader.go
@@ -46,6 +46,7 @@ func header(w io.Writer, pf *File) {
fmt.Fprintln(w, " \"sort\"")
fmt.Fprintln(w, " \"sync\"")
fmt.Fprintln(w, " \"iter\"")
+ fmt.Fprintln(w, " \"go.wit.com/lib/config\"")
fmt.Fprintln(w, ")")
fmt.Fprintln(w, "")
}
@@ -78,10 +79,18 @@ func (pb *File) addNewFunc(w io.Writer) {
fmt.Fprintln(w, " x.Uuid = \""+UUID+"\"")
fmt.Fprintln(w, " x.Version = \""+VERSION+" "+pb.GoPath+"\"")
if pb.DoSave {
- fmt.Fprintln(w, " // x.Filename = \""+VERSION+" "+pb.GoPath+"\"")
- } else {
- fmt.Fprintln(w, " // wasn't here x.Filename = \""+VERSION+" "+pb.GoPath+"\"")
+ fmt.Fprintln(w, " // x.Filename = \"/tmp/"+STRUCT+".pb\"")
}
fmt.Fprintln(w, " return x")
fmt.Fprintln(w, "}")
+ if pb.DoSave {
+ fmt.Fprintln(w, "")
+ fmt.Fprintln(w, "func (pb *"+STRUCT+") Save() error {")
+ fmt.Fprintln(w, " return config.Save(pb)")
+ fmt.Fprintln(w, "}")
+ fmt.Fprintln(w, "")
+ fmt.Fprintln(w, "func (pb *"+STRUCT+") Load() error {")
+ fmt.Fprintln(w, " return config.Load(pb)")
+ fmt.Fprintln(w, "}")
+ }
}