From d850ec82c849d9226a9558e46ad4ad226c91a16e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 8 Jan 2025 20:30:33 -0600 Subject: found mutex --- parseProtoFile.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'parseProtoFile.go') 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 } -- cgit v1.2.3