mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2024-12-29 12:17:48 +00:00
b7695fab0d
We resisted adding Clone for a while since: * It is a function that is perfectly suited for generics. However, generics probably still won't be available in Go for some time and it is impractical to block addition of this function when it is very widely used and will be necessary for the v1 to v2 migration. * In the past, there was no protoreflect.Message.IsValid, so there was no proper API to detect invalid top-level messages and return them as such. Since Clone relies on certain properties about proper round-tripping of ProtoMessage.ProtoReflect <-> Message.Interface, we add a test in testing/prototest to check for this. Change-Id: Ic492b68f27b8b88322a6a3fa3a5e492228db79d9 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/213297 Reviewed-by: Damien Neil <dneil@google.com> |
||
---|---|---|
.. | ||
bench_test.go | ||
decode_gen.go | ||
decode_test.go | ||
decode.go | ||
doc.go | ||
encode_gen.go | ||
encode_test.go | ||
encode.go | ||
equal_test.go | ||
equal.go | ||
extension_test.go | ||
extension.go | ||
isinit_test.go | ||
isinit.go | ||
merge_test.go | ||
merge.go | ||
messageset_test.go | ||
messageset.go | ||
methods_test.go | ||
noenforceutf8_test.go | ||
proto_methods.go | ||
proto_reflect.go | ||
proto.go | ||
reset_test.go | ||
reset.go | ||
size_gen.go | ||
size.go | ||
testmessages_test.go | ||
weak_test.go | ||
wrappers.go |