protobuf-go/cmd/protoc-gen-go
Joe Tsai bfc31022a5 types/known/anypb: gracefully handle nil sources
Add checks so that MarshalFrom and UnmarshalTo consistently matches
the behavior of the proto package with regard to nil messages.
In particular, using a nil message as the destination results in
a panic (which is already the current behavior), while using a
nil message as the source does not panic (it is usually treated as
an untyped empty message). Since an untyped message has no
sensible meaning in the context of Any, return an error.

Change-Id: I99e86c2cdfbd8be57cc039efd550458dc56aadbc
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/237920
Reviewed-by: Damien Neil <dneil@google.com>
2020-06-15 18:37:58 +00:00
..
internal_gengo types/known/anypb: gracefully handle nil sources 2020-06-15 18:37:58 +00:00
testdata internal/cmd/generate-protos: use module= generator option 2020-03-20 21:35:56 +00:00
annotation_test.go internal/genid: add new package for generated identifiers 2020-05-29 07:08:23 +00:00
main.go all: implement support for proto3 optional semantics 2020-04-29 20:02:24 +00:00