diff options
| author | Jeff Carr <[email protected]> | 2025-10-07 01:12:59 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-07 01:12:59 -0500 | 
| commit | 4627d89c4c189869055ac645ce183502c3f035cd (patch) | |
| tree | 263967b5524500281269e30892fca082cba5ee4c | |
| parent | cc11815ce5ff4c8f2b48043136b6a8875a6d547a (diff) | |
nomutex must be the default until pb.Marshal() can be fixedv0.5.17
| -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`") {  | 
