diff options
Diffstat (limited to 'parseProtoFile.go')
| -rw-r--r-- | parseProtoFile.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/parseProtoFile.go b/parseProtoFile.go index c1aa390..cbe670a 100644 --- a/parseProtoFile.go +++ b/parseProtoFile.go @@ -11,13 +11,15 @@ import ( "golang.org/x/text/language" ) +// this parses the .proto file and handles anything with `autogenpb: ` + // finds autogenpb:marshal and autogenpb:unique in the .proto file // // adds fields to []marshal and []unique -func findAutogenpb(names map[string]string) error { +func (pb *Files) findAutogenpb(f *File) error { // log.Info("starting findAutogenpb() on", names["protofile"]) // read in the .proto file - data, err := os.ReadFile(names["protofile"]) + data, err := os.ReadFile(f.Filename) if err != nil { // log.Info("open config file :", err) return err @@ -39,6 +41,14 @@ func findAutogenpb(names map[string]string) error { // log.Info("found unique field", newu) uniqueKeys = append(uniqueKeys, newu) } + if strings.Contains(line, "autogenpb:mutex") { + parts := strings.Split(line, "autogenpb:mutex") + // log.Info("FOUND MUTEX line:", parts[0]) + fields := strings.Fields(parts[0]) + if fields[0] == "message" { + log.Info("FOUND MUTEX:", fields[1]) + } + } } return nil } |
