Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use structural type for AnyResolver & Message #144

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading