diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -103,11 +103,21 @@ func main() { protobase := strings.TrimSuffix(argv.Proto, ".proto") f.Filebase = protobase - if err := pb.findGlobalAutogenpb(f); err != nil { + // parse the .proto file + if err := pb.protoParse(f); err != nil { log.Info("autogenpb parse error:", err) os.Exit(-1) } + // parse sort & marshal options from the .proto file + // this goes through the .proto files and looks + // for `autogenpb: ` lines + if err := pb.protoParseNew(f); err != nil { + log.Info("autogenpb parse error:", err) + os.Exit(-1) + } + + // this should be garbage soon sortmap = make(map[string]string) sortmap["package"] = packageName sortmap["protofile"] = argv.Proto @@ -134,14 +144,6 @@ func main() { os.Exit(0) } - // parse sort & marshal options from the .proto file - // this goes through the .proto files and looks - // for `autogenpb: ` lines - if err := pb.findAutogenpb(f); err != nil { - log.Info("autogenpb parse error:", err) - os.Exit(-1) - } - // try to make foo.pb.go with protoc if it's not here // this is helpful because the protoc-gen-go lines // are also annoying to code by hand |
