start using a common help library
This commit is contained in:
parent
1626a2a501
commit
81d6cd6b74
2
Makefile
2
Makefile
|
@ -38,7 +38,7 @@ recover:
|
||||||
make goimports
|
make goimports
|
||||||
make build
|
make build
|
||||||
|
|
||||||
build: goimports
|
build:
|
||||||
GO111MODULE=off go build \
|
GO111MODULE=off go build \
|
||||||
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
||||||
# autogen uses autogen to build. keep a working copy somewhere
|
# autogen uses autogen to build. keep a working copy somewhere
|
||||||
|
|
15
main.go
15
main.go
|
@ -73,21 +73,6 @@ func main() {
|
||||||
badExit(fmt.Errorf("Base was nil. 'message %s {` did not exist", pf.Filebase))
|
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 you have gotten here, at least the .proto buf file is OK
|
||||||
if argv.DryRun {
|
if argv.DryRun {
|
||||||
// show the protobuf of the protobuf. It's like Inception
|
// show the protobuf of the protobuf. It's like Inception
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"go.wit.com/lib/fhelp"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
"golang.org/x/text/cases"
|
"golang.org/x/text/cases"
|
||||||
"golang.org/x/text/language"
|
"golang.org/x/text/language"
|
||||||
|
@ -69,6 +70,13 @@ func (pb *Files) protoParse(pf *File) error {
|
||||||
return err
|
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
|
// read in the .proto file
|
||||||
data, err := os.ReadFile(pf.Filename)
|
data, err := os.ReadFile(pf.Filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue