diff options
| -rw-r--r-- | generateHeader.go | 2 | ||||
| -rw-r--r-- | protoParse.go | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/generateHeader.go b/generateHeader.go index bc2d53f..a36c1e1 100644 --- a/generateHeader.go +++ b/generateHeader.go @@ -83,7 +83,7 @@ func (pb *File) addNewFunc(w io.Writer) { if pb.DoSave { fmt.Fprintln(w, "") fmt.Fprintln(w, "func (pb *"+STRUCT+") Save() error {") - fmt.Fprintln(w, " return config.Save(pb)") + fmt.Fprintln(w, " return config.SavePB(pb, pb.Filename)") fmt.Fprintln(w, "}") fmt.Fprintln(w, "") fmt.Fprintln(w, "func (pb *"+STRUCT+") Load() error {") diff --git a/protoParse.go b/protoParse.go index e09bbc3..6ecaa9d 100644 --- a/protoParse.go +++ b/protoParse.go @@ -191,12 +191,15 @@ func (pf *File) parseForMessage(line string) *MsgName { msg.Lockname = pf.Filebase + "Mu" // this should be lowercase. do not export the Mutex msg.NeedIter = true + // making this the default. it's confirmed pb.Marshal() panics with the existance of a sync var + msg.NoMutex = true if strings.Contains(line, "`autogenpb:mutex`") { msg.DoMutex = true + msg.NoMutex = false // log.Info("Added Mutex=true:", msg.Name) } if strings.Contains(line, "`autogenpb:nomutex`") { - msg.NoMutex = true + // msg.NoMutex = true // log.Info("Added Mutex=true:", msg.Name) } if strings.Contains(line, "`autogenpb:marshal`") { |
