diff --git a/protoc.go b/protoc.go index 01012cb..b37e50e 100644 --- a/protoc.go +++ b/protoc.go @@ -33,7 +33,8 @@ This returns (UUID, Version, error on failure) func ValidProtobuf(filename string) (string, string, error) { filebase := strings.TrimSuffix(filename, ".proto") base := cases.Title(language.English, cases.NoLower).String(filebase) - pluralBase := base + "s" // to conform to autogenpb, it must have an added 's' + pluralBase := base + "s" // to conform to autogenpb, it must have an added 's' + pluralBase2 := base + "es" // english is annoying, so allow this too file, err := os.Open(filename) if err != nil { @@ -46,9 +47,12 @@ func ValidProtobuf(filename string) (string, string, error) { prefix := "message " + pluralBase + " {" if !strings.HasPrefix(line, prefix) { - // log.Info("nope", prefix, "line", line) - // nope, not this line - continue + prefix = "message " + pluralBase2 + " {" + if !strings.HasPrefix(line, prefix) { + // log.Info("nope", prefix, "line", line) + // nope, not this line + continue + } } scanner.Scan()