diff options
Diffstat (limited to 'addMutex.go')
| -rw-r--r-- | addMutex.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/addMutex.go b/addMutex.go index 78abb6b..1b1db0c 100644 --- a/addMutex.go +++ b/addMutex.go @@ -40,15 +40,18 @@ func (pb *Files) addMutex(f *File) error { // marshalThing(w, msg.Name) // log.Info("line:", line) if strings.HasSuffix(line, start) { - if msg.DoMutex { - msg.MutexFound = true - found = true + msg.MutexFound = true + found = true + if argv.Mutex { log.Info("Adding Mutex to line:", line) fmt.Fprintln(w, line) fmt.Fprintln(w, "\tLock sync.RWMutex // auto-added by go.wit.com/apps/autogenpb") fmt.Fprintln(w, "") } else { - log.Info("Skipping. DoMutex = false for", msg.Name) + log.Info("Skipping. Mutex = false for", msg.Name) + fmt.Fprintln(w, line) + fmt.Fprintln(w, "\t// Lock sync.RWMutex // autogenpb skipped this. needs --mutex command line arg") + fmt.Fprintln(w, "") } } } |
