protobuf-go/internal
Michael Stapelberg 8878926ea7 internal/impl: fix WhichOneof() to work with synthetic oneofs
This is the equivalent of CL 638495, but for the Opaque API.

While the behavior is the same for non-synthetic oneofs between
the Open Struct API and Opaque API, the behavior for synthetic oneofs
is not the same: Because the Opaque API uses a bitfield to store
presence, we need to use the Opaque presence check in WhichOneof().

This CL extends the testproto generator to use the protoc
command-line flag for the test3 testproto (which specifies
syntax = "proto3";), as the in-file api_level is only available
in .proto files using editions (but editions does not use synthetic
oneofs for optional fields, only proto3 does).

For golang/protobuf#1659

Change-Id: I0a1fd6e5fc6f96eeab043f966728ce2a14dbd446
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/638515
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Chressie Himpel <chressie@google.com>
2024-12-23 05:33:29 -08:00
..
benchmarks all: fix deprecated 2024-04-23 09:50:20 +00:00
cmd internal/impl: fix WhichOneof() to work with synthetic oneofs 2024-12-23 05:33:29 -08:00
conformance types/descriptorpb: regenerate using latest protobuf v29.1 release 2024-12-06 14:51:30 +00:00
descfmt all: implement proto2/proto3 as editions [2/2] 2024-03-19 12:54:36 +00:00
descopts internal/descopts,internal/impl: remove shorthand import aliases 2024-08-20 12:08:45 +00:00
detrand internal/impl: introduce instability to protoreflect.Message.Range order 2020-07-01 17:34:30 +00:00
editiondefaults all: regenerate.bash for Opaque API 2024-12-11 03:17:04 -08:00
editionssupport all: implement strip_enum_prefix editions feature 2024-10-23 09:04:58 +00:00
encoding internal/encoding/json: remove duplicate test 2024-08-23 08:40:28 +00:00
errors internal/errors: delete compatibility code for Go before 1.13 2024-12-18 08:09:14 -08:00
filedesc all: Release the Opaque API 2024-12-11 03:16:51 -08:00
filetype all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
flags all: gofmt all 2022-01-04 22:57:54 +00:00
fuzz all: implement depth limit for unmarshaling 2022-02-17 17:07:31 +00:00
fuzztest all: fix deprecated 2024-04-23 09:50:20 +00:00
genid all: regenerate.bash for Opaque API 2024-12-11 03:17:04 -08:00
impl internal/impl: fix WhichOneof() to work with synthetic oneofs 2024-12-23 05:33:29 -08:00
msgfmt all: drop unnecessary import renames for consistency 2024-08-30 09:35:51 +00:00
order all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
pragma all: add a test for copyright headers 2020-02-21 18:41:46 +00:00
protobuild all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
protolazy all: Release the Opaque API 2024-12-11 03:16:51 -08:00
protolegacy all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
race_test all: Release the Opaque API 2024-12-11 03:16:51 -08:00
reflection_test all: Release the Opaque API 2024-12-11 03:16:51 -08:00
set internal/set: remove Int32s, Int64s, and Strings 2019-04-03 22:53:35 +00:00
strs all: remove unused purego support 2024-08-20 08:15:14 +00:00
test/race internal/impl: ensure proto.HasExtension does not allocate 2024-03-28 16:31:28 +00:00
testprotos internal/impl: fix WhichOneof() to work with synthetic oneofs 2024-12-23 05:33:29 -08:00
version all: start v1.36.1-devel 2024-12-23 04:48:38 -08:00
weakdeps all: gofmt all 2022-01-04 22:57:54 +00:00