protobuf-go/internal/impl
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
..
api_export_opaque.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
api_export.go
bitmap_race.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
bitmap.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
checkinit.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
codec_extension.go internal/impl: remove unused ExtensionField.SetLazy method 2024-08-16 07:37:51 +00:00
codec_field_opaque.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
codec_field.go internal/impl: skip unnecessary requiredField checks for oneofs 2024-08-28 08:50:43 +00:00
codec_gen.go
codec_map_go111.go
codec_map_go112.go
codec_map.go
codec_message_opaque.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
codec_message.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
codec_messageset.go
codec_tables.go
codec_unsafe.go all: remove unused purego support 2024-08-20 08:15:14 +00:00
convert_list.go
convert_map.go
convert.go internal/descopts,internal/impl: remove shorthand import aliases 2024-08-20 12:08:45 +00:00
decode.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
encode.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
enum_test.go
enum.go
equal.go proto: Implement proto.Equal fast-path 2024-09-06 16:39:44 +00:00
extension_test.go
extension.go
lazy_buffersharing_test.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
lazy_field_normalized_test.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
lazy_normalized_test.go
lazy_test.go internal/impl: fix TestMarshalMessageSetLazyRace (was a no-op!) 2024-11-04 08:59:09 +00:00
lazy.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
legacy_aberrant_test.go
legacy_enum.go
legacy_export_test.go
legacy_export.go
legacy_extension.go
legacy_file_test.go
legacy_file.go
legacy_message.go
legacy_test.go
merge_gen.go
merge.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
message_opaque_gen.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
message_opaque.go internal/impl: fix WhichOneof() to work with synthetic oneofs 2024-12-23 05:33:29 -08:00
message_reflect_field_gen.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
message_reflect_field.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
message_reflect_gen.go
message_reflect_test.go
message_reflect.go internal/impl: revert IsSynthetic() check to fix panic 2024-12-23 04:34:27 -08:00
message.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
pointer_unsafe_opaque.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
pointer_unsafe.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
presence.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
validate.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
weak.go