protobuf-go/proto
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
..
bench_test.go all: fix typos 2022-05-19 09:32:38 +00:00
checkinit_test.go all: implement features.field_presence = LEGACY_REQUIRED support 2024-02-21 14:39:44 +00:00
checkinit.go all: consistently treat nil message interface as an empty read-only message 2020-04-20 23:12:56 +00:00
decode_gen.go all: return less-specific, but more informative wire unmarshal errors 2020-07-23 20:09:00 +00:00
decode_test.go internal/errors: delete compatibility code for Go before 1.13 2024-12-18 08:09:14 -08:00
decode.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
doc.go all: modernize documentation 2023-09-05 14:55:28 +00:00
encode_gen.go encoding/protowire: make package publicly available 2020-03-20 07:42:18 +00:00
encode_test.go internal/errors: delete compatibility code for Go before 1.13 2024-12-18 08:09:14 -08:00
encode.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
equal_test.go proto: refactor equal_test from explicit table to use makeMessages() 2024-10-29 12:41:43 +00:00
equal.go proto: Implement proto.Equal fast-path 2024-09-06 16:39:44 +00:00
extension_test.go all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
extension.go proto: extend documentation of GetExtension, SetExtension 2024-08-27 10:59:06 +00:00
fuzz_test.go all: remove Go 1.17 build tags / workarounds 2024-05-13 14:03:25 +00:00
lazy_bench_test.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
lazy_roundtrip_test.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
merge_test.go all: implement support for proto3 optional semantics 2020-04-29 20:02:24 +00:00
merge.go all: modernize documentation 2023-09-05 14:55:28 +00:00
messageset_test.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
messageset.go proto: return an error instead of producing invalid wire format 2024-04-18 07:12:00 +00:00
methods_test.go all: gofmt all 2022-01-04 22:57:54 +00:00
nil_test.go all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
noenforceutf8_test.go all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
oneof_get_test.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
oneof_set_test.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
oneof_which_test.go internal/impl: fix WhichOneof() to work with synthetic oneofs 2024-12-23 05:33:29 -08:00
proto_methods.go all: gofmt all 2022-01-04 22:57:54 +00:00
proto_reflect.go all: gofmt all 2022-01-04 22:57:54 +00:00
proto.go all: modernize documentation 2023-09-05 14:55:28 +00:00
repeated_test.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
reset_test.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
reset.go all: improve panic messages for better debugability 2020-05-05 21:10:54 +00:00
size_gen.go all: funnel similar functionality through a single function 2020-05-15 18:21:49 +00:00
size_test.go proto: add examples for Size, MarshalAppend (regarding allocations) 2024-04-02 08:46:54 +00:00
size.go proto: add reference to size semantics with lazy decoding to comment 2024-12-16 00:37:46 -08:00
testmessages_opaque_test.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
testmessages_test.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
validate_test.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
weak_test.go testing/protopack: make package publicly available 2020-03-20 18:05:51 +00:00
wrapperopaque_test.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
wrapperopaque.go all: Release the Opaque API 2024-12-11 03:16:51 -08:00
wrappers.go proto: move T->*T wrappers from internal/scalar to proto 2019-07-12 17:35:01 +00:00