From d9e5edb3a8486bc884841137095dd910e42b3a98 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 10 Jan 2025 04:37:54 -0600 Subject: hotfix --- addMutex.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'addMutex.go') diff --git a/addMutex.go b/addMutex.go index 1b1db0c..5e374f8 100644 --- a/addMutex.go +++ b/addMutex.go @@ -39,7 +39,7 @@ func (pb *Files) addMutex(f *File) error { start := "type " + msg.Name + " struct {" // marshalThing(w, msg.Name) // log.Info("line:", line) - if strings.HasSuffix(line, start) { + if strings.HasPrefix(line, start) { msg.MutexFound = true found = true if argv.Mutex { @@ -53,6 +53,8 @@ func (pb *Files) addMutex(f *File) error { fmt.Fprintln(w, "\t// Lock sync.RWMutex // autogenpb skipped this. needs --mutex command line arg") fmt.Fprintln(w, "") } + // important to exit here. somehow this matched twice at one point. notsure how + break } } if !found { -- cgit v1.2.3