easyjson
easyjson copied to clipboard
Allow using pointer receivers, and use struct pointers for input parameters
This PR changes two things:
- It adds a boolean
ptr_receiversflag (defaultfalse), that, when set to true, causes generatedMarshal[Easy]JSONmethods to be generated with a pointer receiver instead of a value receiver. - It causes internal, generated marshaling functions to expect input structs to be passed as pointers instead of values.
This PR unconditionally reverts the effect of #15 on the generated internal functions, and allows conditionally reverting the effect of #15 on the generated external (exported) methods.
The motivation is to allow easyjson to work with the new Google protobuf API (see fixed issue).
Fixes #348 .
Could any of the maintainers please take a look at this?
@bulletmys @GoWebProd would it be possible to take a look at this PR?
@gobwas any chance you could look at this?