Skip to content

Commit

Permalink
refactor: use structural type for AnyResolver & Message (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Aug 12, 2024
1 parent 5312ce8 commit a2d130f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion jsonpb/jsonpb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion proto/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a2d130f

Please sign in to comment.