Skip to content

Commit a3619c1

Browse files
committed
all: use new protogen options API
Change-Id: Ib7ef4f9e8a6b7ada1f0cba4ae706be9fb8f7a10c Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221559 Reviewed-by: Damien Neil <dneil@google.com>
1 parent d935ec2 commit a3619c1

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ go 1.9
44

55
require (
66
github.com/google/go-cmp v0.4.0
7-
google.golang.org/protobuf v0.0.0-20200225203307-f6cf4925a90e
7+
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60
88
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IV
88
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
99
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
1010
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
11-
google.golang.org/protobuf v0.0.0-20200225203307-f6cf4925a90e h1:wrJFqPhiw6ByHbcNMcv/+6kk7HQLewtkSxANqkwtQ/0=
12-
google.golang.org/protobuf v0.0.0-20200225203307-f6cf4925a90e/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
11+
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60 h1:qkfzMNEf79BNs1//mQGZjYHIXAOv+AOdvPnMsU6R+1I=
12+
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=

internal/cmd/generate-alias/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func main() {
8282
}
8383

8484
// Use the internal logic of protoc-gen-go to generate the files.
85-
gen, err := protogen.New(&req, nil)
85+
gen, err := protogen.Options{}.New(&req)
8686
check(err)
8787
for _, file := range gen.Files {
8888
if file.Generate {

protoc-gen-go/main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ func main() {
4545
}
4646
return importPath
4747
}
48-
opts := &protogen.Options{
48+
protogen.Options{
4949
ParamFunc: flags.Set,
5050
ImportRewriteFunc: importRewriteFunc,
51-
}
52-
protogen.Run(opts, func(gen *protogen.Plugin) error {
51+
}.Run(func(gen *protogen.Plugin) error {
5352
grpc := false
5453
for _, plugin := range strings.Split(*plugins, ",") {
5554
switch plugin {

0 commit comments

Comments
 (0)