mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-06 10:01:25 +00:00
50f860a45a
Suppose you have a generated message with an enum field that has a default value, where the enum is declared in another proto file that does not register its descriptors. In such a situation, the enum dependency cannot be resolved and will be left as a placeholder. When unmarshalDefault is called, it will attempt to parse the enum name stored as the default value, but panic since the placeholder enum has no enum values known to it. Instead of panicking, use a placeholder enum value that preserves the name of default enum value and just use the enum number of 0. This is not ideal, but is a better alternative than panicking. Change-Id: I5ff6c351adbdd6fe7b41f2d4f215be4aa09e751f Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/192500 Reviewed-by: Damien Neil <dneil@google.com> |
||
---|---|---|
.. | ||
build_test.go | ||
build.go | ||
desc_init.go | ||
desc_lazy.go | ||
desc_list_gen.go | ||
desc_list.go | ||
desc_test.go | ||
desc.go | ||
placeholder.go |