diff options
Diffstat (limited to 'newsort.go')
| -rw-r--r-- | newsort.go | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -3,6 +3,8 @@ package main import ( "os" "strings" + + "go.wit.com/log" ) func (pb *Files) makeNewSortfile(pf *File) { @@ -10,12 +12,15 @@ func (pb *Files) makeNewSortfile(pf *File) { header(f, pf) - if sortmap["lock"] == "all" { - // if the lock is set to 'all' this means the mutex was put in the protoc-gen-go struct - } else { - syncLock(f, sortmap) + for _, msg := range pf.MsgNames { + if msg.DoMutex { + pf.syncLock(f, msg.Lockname) + pf.iterTop(f, msg.Name) + } else { + log.Info("Skipping syncLock() for", msg.Name, "DoMutex = false") + } } - iterTop(f, sortmap) + iterNext(f, sortmap) iterAppend(f, sortmap) // Append() enforce no unique keys iterSortAll(f, sortmap) |
