Permalink
3 comments
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
553 additions
and 40 deletions.
- +6 −3 Makefile
- +274 −36 proto/example.pb.go
- +74 −0 proto/example.pb.gw.go
- +16 −0 proto/example.proto
- +15 −0 proto/example.validator.pb.go
- +51 −0 server/server.go
- +69 −0 server/server_test.go
- +1 −1 statik/statik.go
- +47 −0 third_party/OpenAPI/example.swagger.json
Oops, something went wrong.
This comment has been minimized.
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.
This comment has been minimized.
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.
This comment has been minimized.
super helpful @johanbrandhorst, thanks so much. looks like it's time for a refactor!