-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
807d213
commit 6c21737
Showing
9 changed files
with
553 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
6c21737
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm trying to replicate this for my own app and am getting the following compile error: generated/api/v1/acct_service.pb.gw.go:128:24: cannot use fieldMask (type *fieldmaskpb.FieldMask) as type *types.FieldMask in assignment
i believe the issue might be related to grpc-ecosystem/grpc-gateway#812 where the grpc gateway will automatically populate a fieldmask using the json request. that fieldmask type is using the standard protobuf fieldmask type while gogo is using an identically structured, but different fieldmask type.
please note i'm a go beginner and programming is not my day job, so apologize if i'm missing something obvious or not using correct terminology.
6c21737
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @wolfinger, I wrote a blog post about these sort of errors a while back: https://jbrandhorst.com/post/gogoproto/. My recommendation nowadays is just to avoid using gogo protobuf altogether. You can make it work but there are both obvious and non obvious warts in the process and it's not worth the potential speed increase.
6c21737
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super helpful @johanbrandhorst, thanks so much. looks like it's time for a refactor!