summaryrefslogtreecommitdiff
path: root/sort.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-01 00:46:06 -0600
committerJeff Carr <[email protected]>2024-12-01 00:46:06 -0600
commit3261af8db398bfe9a224c3a5f5448981709258d1 (patch)
treecd2ceb5a08e2dbcecf423fa365b7504226b0c70c /sort.go
parent9a34961d3de3df092ab05d91150486166fe9a70a (diff)
sort using mutex from protobuf structv0.0.6
Diffstat (limited to 'sort.go')
-rw-r--r--sort.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/sort.go b/sort.go
index 12e1181..0b884d9 100644
--- a/sort.go
+++ b/sort.go
@@ -13,7 +13,12 @@ func makeSortfile() {
f, _ := os.OpenFile(sortmap["protobase"]+".sort.pb.go", os.O_WRONLY|os.O_CREATE, 0600)
header(f, sortmap)
- syncLock(f, sortmap)
+
+ 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)
+ }
iterTop(f, sortmap)
iterNext(f, sortmap)
iterAppend(f, sortmap) // Append() enforce no unique keys
@@ -190,7 +195,6 @@ func iterEnd(w io.Writer, names map[string]string) {
fmt.Fprintln(w, "")
fmt.Fprintln(w, " return aStuff")
fmt.Fprintln(w, "}")
- fmt.Fprintln(w, "")
}
func iterAppend(w io.Writer, names map[string]string) {