Add --go_opt flag to adapt to the version after 1.4.0 of protoc-gen-go (#767)

Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
This commit is contained in:
anqiansong
2021-07-08 10:11:11 +08:00
committed by GitHub
parent 22a1315136
commit efdf475da4
8 changed files with 89 additions and 16 deletions

View File

@@ -17,6 +17,7 @@ func RPC(c *cli.Context) error {
out := c.String("dir")
style := c.String("style")
protoImportPath := c.StringSlice("proto_path")
goOptions := c.StringSlice("go_opt")
if len(src) == 0 {
return errors.New("missing -src")
}
@@ -29,7 +30,7 @@ func RPC(c *cli.Context) error {
return err
}
return g.Generate(src, out, protoImportPath)
return g.Generate(src, out, protoImportPath, goOptions...)
}
// RPCNew is to generate rpc greet service, this greet service can speed