diff options
| author | Jeff Carr <[email protected]> | 2025-01-08 20:30:33 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-08 20:30:33 -0600 |
| commit | d850ec82c849d9226a9558e46ad4ad226c91a16e (patch) | |
| tree | d4f6b55d9cea51221a6bce90b69c85bcff7b9b7c /parseProtoFile.go | |
| parent | 40bb6caf20e48bbed11455a274d7359673beb5a2 (diff) | |
found mutex
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 } |
