From d6a57064ada093b615fc18a1cd8e5e9ad0fc7495 Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Fri, 9 Aug 2024 14:43:42 +0200 Subject: [PATCH 1/3] type change --- proto/lib.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() From d32a49ab7a6cc68b8a7bbec855153be11458f301 Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Fri, 9 Aug 2024 16:02:55 +0200 Subject: [PATCH 2/3] some more changes --- jsonpb/jsonpb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) } From 9c5f5cda781fae0cc932b35fd79b505c183225a2 Mon Sep 17 00:00:00 2001 From: Marko Baricevic Date: Mon, 12 Aug 2024 10:57:42 +0200 Subject: [PATCH 3/3] add changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) 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.