diff --git a/CHANGELOG.md b/CHANGELOG.md index eba6cd33..18898912 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Improvments + +[#144](https://github.com/cosmos/gogoproto/pull/144) Change proto.Message and jsonpb.Anyresolver to aliased types to allow different implementations of the same interface. + ## [v1.6.0](https://github.com/cosmos/gogoproto/releases/tag/v1.6.0) - 2024-08-08 - [#142](https://github.com/cosmos/gogoproto/pull/142) Update code generator to make grpc `ServiceDesc` public. diff --git a/jsonpb/jsonpb.go b/jsonpb/jsonpb.go index cd812048..f7e88d69 100644 --- a/jsonpb/jsonpb.go +++ b/jsonpb/jsonpb.go @@ -88,7 +88,7 @@ type Marshaler struct { // AnyResolver takes a type URL, present in an Any message, and resolves it into // an instance of the associated message. -type AnyResolver interface { +type AnyResolver = interface { Resolve(typeUrl string) (proto.Message, error) } diff --git a/proto/lib.go b/proto/lib.go index 463c86d5..e94da451 100644 --- a/proto/lib.go +++ b/proto/lib.go @@ -335,7 +335,7 @@ func (nf *nonFatal) Merge(err error) (ok bool) { } // Message is implemented by generated protocol buffer messages. -type Message interface { +type Message = interface { Reset() String() string ProtoMessage()