compiler/protogen: document --go_opt in addition to --go_out Fixes golang/protobuf#1686 Change-Id: I88d6534ce5159dc48053949fe42e6f9eeb7d5bdf Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/737460 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Lasse Folger <lassefolger@google.com>
diff --git a/compiler/protogen/protogen.go b/compiler/protogen/protogen.go index 4af705f..6db0385 100644 --- a/compiler/protogen/protogen.go +++ b/compiler/protogen/protogen.go
@@ -131,10 +131,11 @@ // generator parameter. // // Plugins for protoc can accept parameters from the command line, - // passed in the --<lang>_out protoc, separated from the output - // directory with a colon; e.g., + // passed in the --<lang>_opt protoc flag, in addition to the + // (required) output directory in --<lang>_out; e.g., // - // --go_out=<param1>=<value1>,<param2>=<value2>:<output_directory> + // --go_opt=<param1>=<value1>,<param2>=<value2> + // --go_out=<output_directory> // // Parameters passed in this fashion as a comma-separated list of // key=value pairs will be passed to the ParamFunc.
diff --git a/internal/cmd/generate-protos/main.go b/internal/cmd/generate-protos/main.go index 7eb6a9f..305f351 100644 --- a/internal/cmd/generate-protos/main.go +++ b/internal/cmd/generate-protos/main.go
@@ -411,7 +411,7 @@ opts += fmt.Sprintf(",apilevelM%v=%v", relPath, "API_OPEN") } } - protoc("-I"+filepath.Join(repoRoot, "src"), "-I"+filepath.Join(protoRoot, "src"), "-I"+repoRoot, "--go_out="+opts+":"+tmpDir, filepath.Join(repoRoot, relPath)) + protoc("-I"+filepath.Join(repoRoot, "src"), "-I"+filepath.Join(protoRoot, "src"), "-I"+repoRoot, "--go_opt="+opts, "--go_out="+tmpDir, filepath.Join(repoRoot, relPath)) return nil })