diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -109,15 +109,16 @@ func main() { // experiment to add a mutex to the structs. // this might fix my other not so great lock implementation on sort (?) - // not sure though because I haven't tried it. leave it here until - // I can test it - if err := addMutex(sortmap); err == nil { - log.Info("adding mutex to existing protoc-gen-go file worked") - sortmap["mutex"] = "true" - sortmap["lock"] = "all" - } else { - log.Info("adding mutex to existing protoc-gen-go file did not work") - sortmap["mutex"] = "false" + // seems to work, but proto.Marshal() breaks with nil reference + if argv.Mutex { + if err := addMutex(sortmap); err == nil { + log.Info("adding mutex to existing protoc-gen-go file worked") + sortmap["mutex"] = "true" + sortmap["lock"] = "all" + } else { + log.Info("adding mutex to existing protoc-gen-go file did not work") + sortmap["mutex"] = "false" + } } } |
