summaryrefslogtreecommitdiff
path: root/addMutex.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-09 20:08:22 -0600
committerJeff Carr <[email protected]>2025-01-09 20:08:22 -0600
commit3f81cca18c6f55f303bddc5c4d992cd53894726e (patch)
tree34a38e7d6a3037915f10d82de06d7f0bc8f71bba /addMutex.go
parent948af64ea2b6e586f4d152fcfc7ed168dae4c919 (diff)
example is working okay
Diffstat (limited to 'addMutex.go')
-rw-r--r--addMutex.go11
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, "")
}
}
}