Skip to content

Commit 86e4605

Browse files
committed
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>
1 parent 8c4c4ae commit 86e4605

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

compiler/protogen/protogen.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,11 @@ type Options struct {
131131
// generator parameter.
132132
//
133133
// Plugins for protoc can accept parameters from the command line,
134-
// passed in the --<lang>_out protoc, separated from the output
135-
// directory with a colon; e.g.,
134+
// passed in the --<lang>_opt protoc flag, in addition to the
135+
// (required) output directory in --<lang>_out; e.g.,
136136
//
137-
// --go_out=<param1>=<value1>,<param2>=<value2>:<output_directory>
137+
// --go_opt=<param1>=<value1>,<param2>=<value2>
138+
// --go_out=<output_directory>
138139
//
139140
// Parameters passed in this fashion as a comma-separated list of
140141
// key=value pairs will be passed to the ParamFunc.

internal/cmd/generate-protos/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ func generateLocalProtos() {
411411
opts += fmt.Sprintf(",apilevelM%v=%v", relPath, "API_OPEN")
412412
}
413413
}
414-
protoc("-I"+filepath.Join(repoRoot, "src"), "-I"+filepath.Join(protoRoot, "src"), "-I"+repoRoot, "--go_out="+opts+":"+tmpDir, filepath.Join(repoRoot, relPath))
414+
protoc("-I"+filepath.Join(repoRoot, "src"), "-I"+filepath.Join(protoRoot, "src"), "-I"+repoRoot, "--go_opt="+opts, "--go_out="+tmpDir, filepath.Join(repoRoot, relPath))
415415
return nil
416416
})
417417

0 commit comments

Comments
 (0)