mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-02-04 03:39:48 +00:00
a0d1c75183
Many usages of the legacy ptypes.Timestamp and ptypes.Duration rely on the functions implicitly returning an error for a nil message. In order to migrate previous usages of the ptypes constructors to the new API, we modify CheckValid to preserve similar semantics. There is some consistency with this change in that: (*M)(nil).IsValid() == (*M)(nil).ProtoReflect().IsValid() where M is Duration, Timestamp, and FieldMask. Change-Id: I05ae152511f9875ea034e78aefb7aab18d17a318 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/238007 Reviewed-by: Damien Neil <dneil@google.com>