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

Support Protocol Buffers #348

Open
peterfajdiga opened this issue Aug 24, 2021 · 3 comments · May be fixed by #376
Open

Support Protocol Buffers #348

peterfajdiga opened this issue Aug 24, 2021 · 3 comments · May be fixed by #376

Comments

@peterfajdiga
Copy link

peterfajdiga commented Aug 24, 2021

Easyjson does not work with structs generated by the Protocol Buffers go generator (protoc-gen-go).

The problem is that easyjson generates the MarshalEasyJSON method with a by-value receiver (introduced in #15), but structs generated by protoc-gen-go shouldn't be copied.

Using a by-reference receiver should solve this issue.

@FJSDS
Copy link

FJSDS commented Aug 30, 2021

use gogo protobuf.

@peterfajdiga
Copy link
Author

peterfajdiga commented Sep 1, 2021

@FJSDS Thanks for the suggestion, but gogo protobuf is not always a suitable alternative. It does not, for example, support optional fields in proto3.

@bendiktv2
Copy link

+1.

It should hopefully marshal to the same as https://pkg.go.dev/google.golang.org/protobuf/encoding/protojson.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants