For golang/protobuf#1657
Change-Id: I7b2b0c30506706015ce278e6054439c9ad9ef727
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/634815
TryBot-Bypass: Michael Stapelberg <stapelberg@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Damien Neil <dneil@google.com>
This updates all generated code to match the contents of the latest
v29.1 release of Protobuf. The main significant change is that
SourceCodeInfo is now extendable (though in a very limited way).
This release of Protobuf includes new conformance tests that do not
pass with the latest version of this protobuf-go module. These have
been added to the list of known-failing tests. However all of them
are marked "required" in the conformance suite so should be likely
be addressed as soon as possible. (This change makes no attempt to
fix any of them.)
Change-Id: Ib554d393d7742b7a616af998eeab84a080a85e0e
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/634015
Reviewed-by: Chressie Himpel <chressie@google.com>
Reviewed-by: Michael Stapelberg <stapelberg@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Calling WhichOneof should not be possible for synthetic oneofs;
on the reflection level, these fields should work as if they
were regular fields, not as if they were oneofs:
> Reflection for proto3 optional fields should work properly. For example, a
> method like Reflection::HasField() should know to look for the hasbit for a
> proto3 optional field. It should not be fooled by the synthetic oneof into
> thinking that there is a case member for the oneof.
From the Protobuf docs at:
https://github.com/protocolbuffers/protobuf/blob/main/docs/implementing_proto3_presence.md#updating-reflection
This change was tested Google-internally as CL 701866153.
Change-Id: Id9500d4aa492acf4ebc6d2d84be07ed81201d2aa
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/632735
Reviewed-by: Chressie Himpel <chressie@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This test was accidentally migrated from proto.GetExtension to
proto.HasExtension in a semi-automated change and nobody noticed.
proto.HasExtension does not actually trigger lazy extension decoding.
I verified this using the dlv debugger:
% go test -tags protolegacy -c -gcflags "all=-N -l"
% dlv exec ./impl.test
Type 'help' for list of commands.
(dlv) r -test.run=TestMarshalMessageSetLazyRace -test.v
Process restarted with PID 3586699
(dlv) b TestMarshalMessageSetLazyRace
Breakpoint 1 set at 0xac9bf6 for google.golang.org/protobuf/internal/impl_test.TestMarshalMessageSetLazyRace() ./lazy_test.go:500
(dlv) c
=== RUN TestMarshalMessageSetLazyRace
> [Breakpoint 1] google.golang.org/protobuf/internal/impl_test.TestMarshalMessageSetLazyRace() ./lazy_test.go:500 (hits goroutine(32):1 total:1) (PC: 0xac9bf6)
=> 500: func TestMarshalMessageSetLazyRace(t *testing.T) {
(dlv) b ExtensionField.lazyInit
Breakpoint 2 set at 0x8da076 for google.golang.org/protobuf/internal/impl.(*ExtensionField).lazyInit() ./codec_extension.go:123
(dlv) c
--- PASS: TestMarshalMessageSetLazyRace (4.07s)
PASS
Process 3586699 has exited with status 0
(dlv) exit
Note how breakpoint 2 is unexpectedly not hit!
Here is how the output changes with my fix:
% go test -tags protolegacy -c -gcflags "all=-N -l"
% dlv --check-go-version=false exec ./impl.test
Type 'help' for list of commands.
(dlv) r -test.run=TestMarshalMessageSetLazyRace -test.v
Process restarted with PID 3587344
(dlv) b TestMarshalMessageSetLazyRace
Breakpoint 1 set at 0xac9bf6 for google.golang.org/protobuf/internal/impl_test.TestMarshalMessageSetLazyRace() ./lazy_test.go:500
(dlv) c
=== RUN TestMarshalMessageSetLazyRace
> [Breakpoint 1] google.golang.org/protobuf/internal/impl_test.TestMarshalMessageSetLazyRace() ./lazy_test.go:500 (hits goroutine(28):1 total:1) (PC: 0xac9bf6)
=> 500: func TestMarshalMessageSetLazyRace(t *testing.T) {
(dlv) b ExtensionField.lazyInit
Breakpoint 2 set at 0x8da076 for google.golang.org/protobuf/internal/impl.(*ExtensionField).lazyInit() ./codec_extension.go:123
(dlv) c
> [Breakpoint 2] google.golang.org/protobuf/internal/impl.(*ExtensionField).lazyInit() ./codec_extension.go:123 (hits goroutine(68):1 total:4) (PC: 0x8da076)
> [Breakpoint 2] google.golang.org/protobuf/internal/impl.(*ExtensionField).lazyInit() ./codec_extension.go:123 (hits goroutine(70):1 total:4) (PC: 0x8da076)
> [Breakpoint 2] google.golang.org/protobuf/internal/impl.(*ExtensionField).lazyInit() ./codec_extension.go:123 (hits goroutine(58):1 total:4) (PC: 0x8da076)
> [Breakpoint 2] google.golang.org/protobuf/internal/impl.(*ExtensionField).lazyInit() ./codec_extension.go:123 (hits goroutine(54):1 total:4) (PC: 0x8da076)
=> 123: func (f *ExtensionField) lazyInit() {
(dlv) bt
0 0x00000000008da076 in google.golang.org/protobuf/internal/impl.(*ExtensionField).lazyInit
at ./codec_extension.go:123
1 0x00000000008dac3e in google.golang.org/protobuf/internal/impl.(*ExtensionField).Value
at ./codec_extension.go:180
2 0x000000000094e5d9 in google.golang.org/protobuf/internal/impl.(*extensionMap).Get
at ./message_reflect.go:276
3 0x000000000095a2ee in google.golang.org/protobuf/internal/impl.(*messageState).Get
at ./message_reflect_gen.go:90
4 0x0000000000890099 in google.golang.org/protobuf/proto.GetExtension
at /usr/local/google/home/stapelberg/protobuf/proto/extension.go:90
5 0x0000000000aca7d4 in google.golang.org/protobuf/internal/impl_test.TestMarshalMessageSetLazyRace.func2.1
at ./lazy_test.go:545
6 0x0000000000aca625 in google.golang.org/protobuf/internal/impl_test.TestMarshalMessageSetLazyRace.func2
at ./lazy_test.go:550
7 0x00000000006001c1 in runtime.goexit
at /usr/lib/google-golang/src/runtime/asm_amd64.s:1700
Change-Id: Ie7a8621064af412a1db7efb3ad6b8473f9db58e8
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/624416
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Chressie Himpel <chressie@google.com>
This required renaming the extension fields to have distinct names, as
makeMessages() uses the protobuild package, which works with field names.
The makeMessages() function can be centrally extended with other variants of
testprotos (e.g. editions).
Change-Id: I68ef28baee674c6b53da8629c5ff7b2e1b92d4ff
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/624415
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Chressie Himpel <chressie@google.com>
This will be useful for a few different upcoming tests,
to be submitted in a follow-up CL.
Change-Id: I1fde9f4567b149141737a74c8448c2ee14946ae4
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/623117
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Chressie Himpel <chressie@google.com>
With this change, we establish a similar mechanism in encoding/prototext as
already exists in the proto package: a testmessages_test.go which serves as an
extension point where one can inject more variants into the corpus of test
messages.
Change-Id: I9f83735a44e5fd2e4736f888aaca428e4cc8ed42
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/623116
Reviewed-by: Chressie Himpel <chressie@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This is important for test coverage: the makeMessages() function is where we
declare the various different test message types. Using this central function is
better than explicitly having to spell out all the various cases in the test
table.
This CL is roughly neutral in terms of lines changed, but actually increases
coverage: in the existing table, not every group of tests had coverage for all
cases (proto2, proto3, editions). This was difficult to spot previously, but now
the different test message types are now clearly spelled out (allTypesNoProto3).
Also, the test now prints the description and message types as subtest name.
This makes it easy to verify coverage by just reading the test output.
Change-Id: I08f541548d087233cbb4686785c456674371c2a3
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/623115
Reviewed-by: Chressie Himpel <chressie@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This change required updating editions_defaults.binpb with
--edition_defaults_maximum=2024 so that we can use edition 2024 in our
testdata/enumprefix.proto test file.
For end users, this feature will only be available once:
1. protoc declares support for edition 2024 (expected early 2025).
2. protoc-gen-go declares support for edition 2024.
related to golang/protobuf#513
Change-Id: Ib8daeecae39ef32eff942279707d256c312f2a53
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/618979
Reviewed-by: Lasse Folger <lassefolger@google.com>
Reviewed-by: Mike Kruskal <mkruskal@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Some other implementations do not send the value field when encoding
an Any representing a message of the Empty Well-Known-Type.
Fixesgolang/protobuf#1620
Change-Id: I89bffd5f92656ba3ac462c0b6365ed4b49e6189d
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/618395
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Stapelberg <stapelberg@google.com>
Also adds better benchmark cases for large message where some fields are
actually populated.
This change was previously done in Google internal cl/660848520.
Change-Id: I682aae0c9c2850bfe7638de29ab743ad7d7b119a
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/609035
Reviewed-by: Christian Höppner <hoeppi@google.com>
Reviewed-by: Cassondra Foesch <cfoesch@gmail.com>
Reviewed-by: Michael Stapelberg <stapelberg@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Most of our imports already comply with the style, but this change makes it
consistent across the entire repository.
I suspect that these unnecessary imports are left-overs from differences between
Google-internal (where many imports are renamed) and Open Source.
Change-Id: Id5f6eabd22bcc72dd4e36dd018b6cc5138df7696
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/609875
Reviewed-by: Christian Höppner <hoeppi@google.com>
Auto-Submit: Michael Stapelberg <stapelberg@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This change was originally done by Mike Kruskal in Google-internal cl/520045664.
(Undeclared extensions are no longer accepted Google-internally.)
Change-Id: I24d24ff2c7dc85920bd5dbe86724186d98783a18
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/609555
Reviewed-by: Christian Höppner <hoeppi@google.com>
Auto-Submit: Michael Stapelberg <stapelberg@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This change was originally done by Patrik Nyblom in Google-internal cl/308876443
(The corresponding test is TestDecodeFastCheckInitialized in methods_test.go.)
Change-Id: I312dff53db4d6f87decf152eb20ec4dd280f03c3
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/608256
Reviewed-by: Christian Höppner <hoeppi@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Document the type mapping and the recommended pattern for working with
extensions. This documentation was Google-internal (cl/335451491), presumably
because of the reference to static analysis tools that don’t exist outside.
Compared to the internal version, this CL uses “should” instead of “must”.
Change-Id: I9293c10b2f6f91c9546d145c94b52e84f3a7a9c9
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/607995
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Christian Höppner <hoeppi@google.com>
Go 1.23 was released a few weeks ago.
Change-Id: Ied9daddbe57b5f57993a31fd09fe1c8c47a42878
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/608316
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Stapelberg <stapelberg@google.com>
Reviewed-by: Christian Höppner <hoeppi@google.com>
This change was originally done in Google-internal cl/512993970.
Change-Id: I66ea95cd975b160892ed9f931312f1767cbc9fc9
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/608315
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Stapelberg <stapelberg@google.com>
Reviewed-by: Christian Höppner <hoeppi@google.com>
This test was accidentally duplicated in CL 569356.
Change-Id: I0e2f81fbebe9b4c37bf6d28615e0bf51d28cfc4c
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/607777
Auto-Submit: Michael Stapelberg <stapelberg@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Christian Höppner <hoeppi@google.com>
This should have been part of CL 606755.
related to golang/protobuf#1640
Change-Id: Iae1bfb9e3bd440f879047d3a78e1bba364d7568c
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/607775
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Christian Höppner <hoeppi@google.com>
This flag is used by the (Google-internal) editions codegen test.
Having the functionality in the open source repository reduces
our maintenance burden (fewer/smaller patches).
Change-Id: Idb9c95e9b2cb8922584bcb7ca13a8ddef4347af0
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/606735
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Lasse Folger <lassefolger@google.com>
This change was originally done by Mike Kruskal in Google-internal cl/515091827.
Change-Id: I5d1588193663249964cf8bc9b9fe9f61d29c98a6
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/606756
Reviewed-by: Christian Höppner <hoeppi@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This cleanup was done in June 2020 by Dan Scales,
but never upstreamed to the open source Go Protobuf repository.
Change-Id: I175d9588b5bb536fa276133f8fe6073278e6d3b0
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/605895
Reviewed-by: Christian Höppner <hoeppi@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Add support for additional primitive types such as int8, int16, uint8, uint16,
and the json.Number type in the conversion logic of the NewValue function.
This change ensures that the generated code can handle a wider range of Go types
when converting them to protobuf Value types, improving compatibility with JSON
data formats.
fixesgolang/protobuf#1463
Change-Id: I6ea7b8f644f6c3dbe5e6c17e744be40c56846328
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/601775
Reviewed-by: Michael Stapelberg <stapelberg@google.com>
Reviewed-by: Lasse Folger <lassefolger@google.com>
Reviewed-by: Funda Secgin <fundasecgin32@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Before this commit, message-level Go editions features were not parsed
correctly.
Change-Id: I94ead5428fadae5fd70ed991fa405ce9388e9660
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/603015
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Stapelberg <stapelberg@google.com>
Reviewed-by: Lasse Folger <lassefolger@google.com>
go_features.proto apparently lived in package google.protobuf,
but was later moved to package pb, without updating generate-protos.
This change fixes the oversight and re-generates go_features_gen.go.
Change-Id: I6fd68fdb7b146f32dd610c0bad6ecf5ec940ae78
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/602055
Reviewed-by: Lasse Folger <lassefolger@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
The IsLazy() method is intentionally not added to the
protoreflect.FieldDescriptor interface because users should not need it.
The Go Protobuf runtime will use type assertion to dynamically call the method.
There is no change in behavior, this is preparation only.
Change-Id: I4500c17f5edd1bdc40447eb89bff115b4e8eab06
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/596539
Reviewed-by: Chressie Himpel <chressie@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Change-Id: I5207e3e1d51e55147a7ec8374548aeb6a5312172
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/595337
Reviewed-by: Lasse Folger <lassefolger@google.com>
Reviewed-by: Michael Stapelberg <stapelberg@google.com>
Auto-Submit: Michael Stapelberg <stapelberg@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
The current error message does not return the field that triggered the error on JSON unmarshal, so the error message was changed to include the field name.
Resolvesgolang/protobuf#1504
Change-Id: I4ae098d2fc39bf68ede3560c36d50f630db5f6b4
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/587536
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Michael Stapelberg <stapelberg@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
All of the other features, including custom features for C++ and Java,
allow setting a file-wide default. This makes it easier to migrate
proto2 files, so that the feature can be set at the file level instead
of needing to manually annotate each enum element. This adds the same
convenience to the (pb.go).legacy_unmarshal_json_enum feature that is
defined in this repo.
Change-Id: If3a925674a9daeed464b589747b7f78a0200118b
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/589336
Auto-Submit: Lasse Folger <lassefolger@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Lasse Folger <lassefolger@google.com>
Reviewed-by: Michael Stapelberg <stapelberg@google.com>
Resolvesgolang/protobuf#1615
The protoc compiler disallows setting the message encoding feature of
map fields to delimited since maps, at least for now (as of edition
2023) should always use normal length-prefixed encoding.
But the field (and a message value field inside the map entry) could
inherit such a feature value if it were set as a file-wide default. At
the point where the code changes the kind from message to group, based
on the field's resolved features, the message type hasn't yet been
resolved. So this change adds a check after the FieldDescriptor's
message type is resolved, to change the kind back from group to
message if the field is a map field or a field in a map entry message.
Change-Id: I785269a4ecd80d1a17866c08b2afc0b01440e0e3
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/588976
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cassondra Foesch <cfoesch@gmail.com>
Reviewed-by: Mike Kruskal <mkruskal@google.com>
Reviewed-by: Michael Stapelberg <stapelberg@google.com>
This updates the repo to use the latest artifacts from the v27.0
final release of protoc.
Change-Id: I4216038b6f40430c3f9209c0bdd387de0b82e23f
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/588875
Reviewed-by: Florian Zenker <floriank@google.com>
Reviewed-by: Michael Stapelberg <stapelberg@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
When a message (within an extension) is lazily decoded, its size cache is
initialized to 0 (the zero value for an int32). This doesn’t mean the size cache
reads 0, but rather that it was not initialized.
This fixes TestExtensionGetRace being flaky since CL 580015.
related to golang/protobuf#1609
Change-Id: Ia305badadd300679975f230005c3e33c94050e4a
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/586396
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Lasse Folger <lassefolger@google.com>
This aligns our policy with the Google Cloud Client Libraries policy.
Other large packages like the AWS SDK follow that same policy.
fixesgolang/protobuf#1613
Change-Id: I33642d3c5e4d79d3b5cdee0e0ff546affa46693e
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/586395
Reviewed-by: Lasse Folger <lassefolger@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This check was removed from protoc in [1] and the comment in
desc_validate.go mentioned that it was there to emulate the protoc
behavior.
[1] 535069ec1bfixesgolang/protobuf#1616
Change-Id: I8cd6a28a4b2f2b807cdd4432b096cfce8e1f28c8
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/585736
Reviewed-by: Nicolas Hillegeer <aktau@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Lasse Folger <lassefolger@google.com>
Extensions will be kept in wire format over proto.Size and proto.Marshal.
This change is a significant performance optimization for jobs that read and
write Protobuf messages of the same type, but do not need to process extensions.
This change is based on work by Patrik Nyblom.
Note that the proto.Size semantics for lazy messages might be surprising;
see https://protobuf.dev/reference/go/size/ for details.
We have been running this change for about two weeks in Google,
all known breakages have already been addressed with CL 579995.
related to golang/protobuf#1609
Change-Id: I16be78d15304d775bb30e76356a1a61d61300b43
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/580015
Reviewed-by: Lasse Folger <lassefolger@google.com>
Auto-Submit: Michael Stapelberg <stapelberg@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>