summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-20 10:46:39 -0500
committerJeff Carr <[email protected]>2025-10-20 10:46:39 -0500
commit1f60db15aa0c8618636f027ca1e81a5009429c27 (patch)
treea162d75947aab1e02987c3bd9faa4591b007cc11
day1v0.0.1
-rw-r--r--.gitignore5
-rw-r--r--Makefile21
-rw-r--r--generate.go9
-rw-r--r--key.proto16
4 files changed, 51 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3429a71
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+go.*
+*.swp
+*.patch
+*.mbox
+*.pb.go
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3f7e55e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,21 @@
+all: autogenpb goimports vet
+ @echo This GO code passes the compile checks
+
+autogenpb:
+ autogenpb --proto key.proto
+
+generate: clean
+ go mod init
+ go mod tidy
+ go generate
+
+goimports:
+ goimports -w *.go
+
+vet:
+ @GO111MODULE=off go vet
+
+clean:
+ rm -f *.pb.go *.patch
+ -rm -f go.*
+ go-mod-clean purge
diff --git a/generate.go b/generate.go
new file mode 100644
index 0000000..62f55ea
--- /dev/null
+++ b/generate.go
@@ -0,0 +1,9 @@
+package ENV
+
+// 'make generate' will call this
+//
+// go generate is a cool feature. many thanks to the GO dev team
+//
+// NOTE: please add to go generate: if ! exists go.mod, run 'go mod init' & 'go mod tidy'
+//
+//go:generate autogenpb --proto key.proto
diff --git a/key.proto b/key.proto
new file mode 100644
index 0000000..7ee7a1f
--- /dev/null
+++ b/key.proto
@@ -0,0 +1,16 @@
+// Copyright 2025 WIT.COM Inc Licensed GPL 3.0
+
+syntax = "proto3";
+
+package ENV;
+
+message Key { //
+ string var = 1; // ENV var name `autogenpb:unique` `autogenpb:sort`
+ string value = 2; // ENV value name
+}
+
+message Keys { // `autogenpb:marshal` `autogenpb:nomutex`
+ string uuid = 1; // `autogenpb:uuid:7a8aaf7f-9851-42f0-89eb-434d2e51f5bb`
+ string version = 2; // `autogenpb:version:v0.0.1 go.wit.com/lib/ENV`
+ repeated Key keys = 3;
+}