summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-08 02:58:10 -0500
committerJeff Carr <[email protected]>2025-10-08 02:58:10 -0500
commitc00dc3919b6f34d6fbf1fdd02d05e27692ccf42a (patch)
tree2a0b64958a015b19ce97ecbb8d185720a9909b5c
parent502e0854e78b9f27bba81c02e27fc86097cbefb5 (diff)
add make generatev0.0.7
-rw-r--r--Makefile10
-rw-r--r--README.md22
-rw-r--r--generate.go14
3 files changed, 24 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 4d586a2..a0f2efc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,12 @@
-all: proto goimports vet
+all: goimports vet
-redo: clean proto goimports vet
+generate: clean
+ go mod init
+ go mod tidy
+ go generate
+
+go-generate:
+ rm -f *.pb.go
vet:
@GO111MODULE=off go vet
diff --git a/README.md b/README.md
index bd80967..d649f23 100644
--- a/README.md
+++ b/README.md
@@ -1,21 +1,3 @@
-This package should be a GO Primitive package and
-therefore have a minimum go.sum file.
+# protobuf definition file for git-bug
-TODO: Appeal to have google.golang.org/protobuf moved into GO itself
-
-# protobuf definition files for git-bug
-
-This is to make a easy way to parse the bugs from
-the federated git-bug system. Search can be implemented
-on top of this protobuf definition instead of being mixed
-in with the database code.
-
-#####
-
-The above was the original intent of this package and
-probably will still be that way, but, this is a good
-name for "bugs" in protobufs themselves and I've
-moved things like the Validate UTF-8 things here.
-
-In general, maybe it'll be more of a toolbox of common
-useful protobuf routines
+an experiement with git-bug
diff --git a/generate.go b/generate.go
new file mode 100644
index 0000000..2250a45
--- /dev/null
+++ b/generate.go
@@ -0,0 +1,14 @@
+package bugpb
+
+// NOTE: it would be helpful if go.mod doesn't exist, that go generate
+// would automatically run go mod init and go mod tidy
+// and allow directives to 'go get go.wit.com/apps/autogenpb'
+// then this process could be fully automated
+//
+//go:generate make go-generate
+//go:generate go get go.wit.com/apps/autogenpb
+//go:generate go install -v go.wit.com/apps/autogenpb
+//go:generate autogenpb --proto bug.proto
+// # go:generate go get golang.org/x/tools # repo seems broken at this time (?)
+// # go:generate go install -v golang.org/x/tools/cmd/goimports
+//go:generate bash -c "goimports -w *.go"