diff options
| author | Jeff Carr <[email protected]> | 2025-01-12 09:28:58 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-12 09:28:58 -0600 |
| commit | d38f5dda75fd4c4ba8adcaf4125f60a50fe3269b (patch) | |
| tree | d7afe68d06123213b7935060a1124c78a475ea40 /protoParse.go | |
| parent | 10f75f87a66a9329fd665bd85099fe94c7beae79 (diff) | |
cleanups and help files
Diffstat (limited to 'protoParse.go')
| -rw-r--r-- | protoParse.go | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/protoParse.go b/protoParse.go index 8b6a313..53f1b6a 100644 --- a/protoParse.go +++ b/protoParse.go @@ -11,8 +11,6 @@ import ( "go.wit.com/log" "golang.org/x/text/cases" "golang.org/x/text/language" - - "github.com/google/uuid" ) // this parses the .proto file and handles anything with `autogenpb: ` @@ -65,52 +63,6 @@ func (pb *Files) hasPluralMessage(f *File) error { return fmt.Errorf("proto file error %s", f.Filename) } -func (pf *File) noPluralMessage() { - base := cases.Title(language.English, cases.NoLower).String(pf.Filebase) - - log.Info("") - log.Info("###########################################################################") - log.Info("Your proto file", pf.Filename, "does not contain the correct 'message' definitions") - log.Info("") - log.Info("For autogenpb to work on your file", pf.Filename, ", you must have both names exactly:") - log.Info("") - log.Printf("message %s {\n", base) - log.Info("}") - log.Printf("message %s {\n", base+"s") - log.Info("}") - log.Info("") - log.Info("###########################################################################") - badExit(fmt.Errorf("proto file error %s", pf.Filename)) -} - -// message Fruits { // `autogenpb:marshal` `autogenpb:mutex` -// string uuid = 1; // `autogenpb:uuid:be926ad9-f07f-484c-adf2-d96eeabf3079` -// string version = 2; // `autogenpb:version:v0.0.1` -// repeated Fruit Fruits = 3; // THIS MUST BE "Fruit" and then "Fruit" + "s" -// } - -func (pf *File) noUuid() { - base := cases.Title(language.English, cases.NoLower).String(pf.Filebase) - id := uuid.New() - - log.Info("") - log.Info("###########################################################################") - log.Info("Your proto file", pf.Filename, "is incorrect for 'message' ", base+"s") - log.Info("") - log.Info("For autogenpb to work on your file", pf.Filename, ",", base+"s must be exactly:") - log.Info("") - log.Info("message", base+"s", "{ // `autogenpb:marshal` `autogenpb:mutex`") - log.Info(" string uuid = 1; // `autogenpb:uuid:" + id.String() + "`") - log.Info(" string version = 2; // `autogenpb:version:v0.0.1`") - log.Info(" repeated", base, base+"s", " = 3; // THIS MUST BE ", base, " and then ", base+"s") - log.Info("}") - log.Info("") - log.Info("If you don't have a UUID, you can use the randomly generated one here") - log.Info("") - log.Info("###########################################################################") - badExit(fmt.Errorf("proto file error %s", pf.Filename)) -} - func (pb *Files) protoParse(pf *File) error { // does the file conform to the standard? (also reads in UUID & Version) if err := pb.hasPluralMessage(pf); err != nil { |
