summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-16 00:18:30 -0600
committerJeff Carr <[email protected]>2024-12-16 00:18:30 -0600
commit50cafc85178b8fee356c6b3b0ac38e0a110841e1 (patch)
tree6cdb680380968c5f88d9933151ec7301db08a24c
parentc3d018df22d40ae93174b092f1ae823abd616eca (diff)
add version and DO NOT EDIT to headerv0.0.30v0.0.29
-rw-r--r--header.go34
-rw-r--r--sort.go28
2 files changed, 34 insertions, 28 deletions
diff --git a/header.go b/header.go
new file mode 100644
index 0000000..1d18e91
--- /dev/null
+++ b/header.go
@@ -0,0 +1,34 @@
+package main
+
+import (
+ "fmt"
+ "io"
+)
+
+func headerComment(w io.Writer) {
+ fmt.Fprintln(w, "")
+ fmt.Fprintln(w, "// This file was autogenerated with autogenpb", VERSION, "DO NOT EDIT")
+ fmt.Fprintln(w, "// go install go.wit.com/apps/autogenpb@latest")
+ fmt.Fprintln(w, "//")
+ fmt.Fprintln(w, "// You can use it on simple protobuf files")
+ fmt.Fprintln(w, "// The .proto file must have a singular and plural form of a message")
+ fmt.Fprintln(w, "// (for those of you that know ruby on rails, it's like that)")
+ fmt.Fprintln(w, "//")
+ fmt.Fprintln(w, "// You can mark which repos you want to auto generate sort.pb.go and marshal.pb.go files for")
+ fmt.Fprintln(w, "//")
+ fmt.Fprintln(w, "// For an example,")
+ fmt.Fprintln(w, "// go-clone go.wit.com/lib/protobuf/gitpb")
+ fmt.Fprintln(w, "//")
+ fmt.Fprintln(w, "")
+}
+
+func header(w io.Writer, names map[string]string) {
+ fmt.Fprintln(w, "package "+names["package"])
+ headerComment(w)
+ fmt.Fprintln(w, "import (")
+ fmt.Fprintln(w, " \"fmt\"")
+ fmt.Fprintln(w, " \"sort\"")
+ fmt.Fprintln(w, " \"sync\"")
+ fmt.Fprintln(w, ")")
+ fmt.Fprintln(w, "")
+}
diff --git a/sort.go b/sort.go
index d8a3aa0..acb8325 100644
--- a/sort.go
+++ b/sort.go
@@ -59,34 +59,6 @@ func makeSortfile() {
iterEnd(f, sortmap)
}
-func headerComment(w io.Writer) {
- fmt.Fprintln(w, "")
- fmt.Fprintln(w, "// This file was autogenerated with autogenpb.")
- fmt.Fprintln(w, "// go install go.wit.com/apps/autogenpb@latest")
- fmt.Fprintln(w, "//")
- fmt.Fprintln(w, "// You can use it on simple protobuf files")
- fmt.Fprintln(w, "// The .proto file must have a singular and plural form of a message")
- fmt.Fprintln(w, "// (for those of you that know ruby on rails, it's like that)")
- fmt.Fprintln(w, "//")
- fmt.Fprintln(w, "// You can mark which repos you want to auto generate sort.pb.go and marshal.pb.go files for")
- fmt.Fprintln(w, "//")
- fmt.Fprintln(w, "// For an example,")
- fmt.Fprintln(w, "// go-clone go.wit.com/lib/protobuf/gitpb")
- fmt.Fprintln(w, "//")
- fmt.Fprintln(w, "")
-}
-
-func header(w io.Writer, names map[string]string) {
- fmt.Fprintln(w, "package "+names["package"])
- headerComment(w)
- fmt.Fprintln(w, "import (")
- fmt.Fprintln(w, " \"fmt\"")
- fmt.Fprintln(w, " \"sort\"")
- fmt.Fprintln(w, " \"sync\"")
- fmt.Fprintln(w, ")")
- fmt.Fprintln(w, "")
-}
-
func syncLock(w io.Writer, names map[string]string) {
fmt.Fprintln(w, "// bad global lock until I figure out some other plan")
fmt.Fprintln(w, "// redo/fix protoc-gen-go 1.35 and do it there?")