summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-09 20:23:52 -0600
committerJeff Carr <[email protected]>2025-01-09 20:23:52 -0600
commitb9fec2e81487b4948a6e221d3768ea4dfb12de42 (patch)
treed0acd5a81617efbc260e56589679103b70b65395
parent3f81cca18c6f55f303bddc5c4d992cd53894726e (diff)
can't sort structs yet
-rw-r--r--Makefile11
-rw-r--r--file.proto4
2 files changed, 10 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index fc8683e..3d7a726 100644
--- a/Makefile
+++ b/Makefile
@@ -3,18 +3,23 @@ BUILDTIME = $(shell date +%Y.%m.%d_%H%M)
test: goimports build test
-full: clean goimports auto vet install
+full: clean goimports auto vet build
vet:
@GO111MODULE=off go vet
@echo this go binary package should build okay
-cleanbuild:
- rm -f auto.marshal.pb.go auto.sort.pb.go autogenpb
+# autogen uses autogen to build. keep a working copy somewhere
+recover:
+ make clean
+ ./autogenpb.last --proto file.proto --package main
+ make goimports
+ make build
build:
GO111MODULE=off go build \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
+ cp -f autogenpb autogenpb.${BUILDTIME}
bak:
mv -f autogenpb autogenpb.last
diff --git a/file.proto b/file.proto
index 87e6836..740761d 100644
--- a/file.proto
+++ b/file.proto
@@ -36,7 +36,7 @@ message MsgName {
repeated string unique = 8; // if the fields should have AppendUnique() functions
}
-message File { // `autogenpb:nomarshal`
+message File {
string Package = 1; // whatever the package name is at the top of the .go file
string filename = 2; // yellow.proto
string pbfilename = 3; // yellow.pb.go
@@ -47,7 +47,7 @@ message File { // `autogenpb:nomarshal`
MsgName base = 8; // the primary repeated message for the master struct
// every struct in this proto file, this file has: "Apple", "Apples", ... "File", etc...
- repeated MsgName msgNames = 9; // `autogenpb:unique` // in this file
+ repeated MsgName msgNames = 9;
}
// I know, I know, the whole point of using protobuf