Skip to content

Commit b929213

Browse files
committed
protoc-gen-go: generate XXX_OneofWrappers instead of XXX_OneofFuncs (#760)
The marshaler, unmarshaler, and sizer functions are unused ever since the underlying implementation was switched to be table-driven. Change the function to only return the wrapper structs. This change: * enables generated protos to drop dependencies on certain proto types * reduces the size of generated protos * simplifies the implementation of oneofs in protoc-gen-go Updates #708 Change-Id: I5d45dacc72549864a0fe5b2bf27de9a31ea91607 Cherry-Pick: github.com/golang/protobuf@8d0c54c1246661d9a51ca0ba455d22116d485eaa Original-Author: Joe Tsai <[email protected]> Reviewed-on: https://go-review.googlesource.com/c/151399 Reviewed-by: Damien Neil <[email protected]>
1 parent e21ef87 commit b929213

File tree

44 files changed

+184
-1714
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+184
-1714
lines changed

conformance/internal/conformance_proto/conformance.pb.go

Lines changed: 27 additions & 271 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module github.com/golang/protobuf
22

33
require (
4-
github.com/golang/protobuf/v2 v2.0.0-20180928215628-ccf3fa6cad50
4+
github.com/golang/protobuf/v2 v2.0.0-20181127193627-d7e97bc71bcb
55
golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3 // indirect
66
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
77
golang.org/x/tools v0.0.0-20180928181343-b3c0be4c978b // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
2-
github.com/golang/protobuf/v2 v2.0.0-20180928215628-ccf3fa6cad50 h1:gM4MP5Fi9r5FbsQY7aYxj/GBqNZUZiKjgYdAoQu129M=
3-
github.com/golang/protobuf/v2 v2.0.0-20180928215628-ccf3fa6cad50/go.mod h1:pUFc/zvPj/qlI5nj8gEgsCPCTpICLT32W2c/kQ1v5HU=
4-
github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
5-
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
6-
golang.org/x/net v0.0.0-20180821023952-922f4815f713/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
1+
github.com/golang/protobuf v1.2.1-0.20181127190454-8d0c54c12466/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0=
2+
github.com/golang/protobuf/v2 v2.0.0-20181127193627-d7e97bc71bcb h1:xAZBrlIILcZ8PEjDVZFkOVURYqYAF9y3+wnJXB/t7I8=
3+
github.com/golang/protobuf/v2 v2.0.0-20181127193627-d7e97bc71bcb/go.mod h1:MgUD+N3FwzDmj2CdMsT5ap7K7jx+c9cQDQ7fVhmH+Xw=
4+
github.com/google/go-cmp v0.2.1-0.20181101181452-745b8ec83783 h1:wVZ6laEGf86tNDTpR5mxFyFIclJJiXCxuJhcQKnsOHk=
5+
github.com/google/go-cmp v0.2.1-0.20181101181452-745b8ec83783/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
6+
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
77
golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3 h1:dgd4x4kJt7G4k4m93AYLzM8Ni6h2qLTfh9n9vXJT3/0=
88
golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
99
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=

jsonpb/jsonpb_test_proto/more_test_objects.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)