summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-13 08:10:17 -0600
committerJeff Carr <[email protected]>2025-01-13 08:10:17 -0600
commit81d6cd6b74fa4b4c94ec13bf02c5b9ac768d36d6 (patch)
tree39762e28005c29749c4cd5fc25a3556b5a6ba208
parent1626a2a50191ea6e0981c3e60c8791e42dec7357 (diff)
start using a common help libraryv0.0.44
-rw-r--r--Makefile2
-rw-r--r--main.go15
-rw-r--r--protoParse.go8
3 files changed, 9 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 7466598..1380f9a 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,7 @@ recover:
make goimports
make build
-build: goimports
+build:
GO111MODULE=off go build \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
# autogen uses autogen to build. keep a working copy somewhere
diff --git a/main.go b/main.go
index 3f6f73b..75f82ba 100644
--- a/main.go
+++ b/main.go
@@ -73,21 +73,6 @@ func main() {
badExit(fmt.Errorf("Base was nil. 'message %s {` did not exist", pf.Filebase))
}
- /*
- // prep the output file
- if !argv.DryRun {
- var err error
- fsort, err = os.OpenFile(pf.Filebase+".newsort.pb.go", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
- if err != nil {
- badExit(err)
- }
- defer fsort.Close()
-
- header(fsort, pf)
- pf.syncLock(fsort)
- }
- */
-
// if you have gotten here, at least the .proto buf file is OK
if argv.DryRun {
// show the protobuf of the protobuf. It's like Inception
diff --git a/protoParse.go b/protoParse.go
index 2c995fe..c039028 100644
--- a/protoParse.go
+++ b/protoParse.go
@@ -8,6 +8,7 @@ import (
"os"
"strings"
+ "go.wit.com/lib/fhelp"
"go.wit.com/log"
"golang.org/x/text/cases"
"golang.org/x/text/language"
@@ -69,6 +70,13 @@ func (pb *Files) protoParse(pf *File) error {
return err
}
+ uuid, version, err := fhelp.ValidProtobuf(pf.Filename)
+ if err != nil {
+ return err
+ }
+ pb.Uuid = uuid
+ pb.Version = version
+
// read in the .proto file
data, err := os.ReadFile(pf.Filename)
if err != nil {