mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-02-23 06:41:09 +00:00
Introduce a protoreflect.OptionsMessage interface type to represent options messages. The protoreflect package can't deal with concrete options types, to avoid dependency cycles; OptionsMessage serves both as documentation and a single point to define the constraints we apply to options. Change the constraints on options from ProtoMessage to interface{} to permit use of option message types which only implement the v1 proto.Message interface. This still leaves a requirement in the internal/legacy package that options implement protoreflect.ProtoMessage, since that package now uses the v2 Unmarshal. Change-Id: I547518ab2c3b90c3911ef641b05b169d50a4b33a Reviewed-on: https://go-review.googlesource.com/c/154877 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>