easyjson icon indicating copy to clipboard operation
easyjson copied to clipboard

Allow using pointer receivers, and use struct pointers for input parameters

Open misberner opened this issue 3 years ago • 3 comments

This PR changes two things:

  • It adds a boolean ptr_receivers flag (default false), that, when set to true, causes generated Marshal[Easy]JSON methods 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 .

misberner avatar Aug 06 '22 04:08 misberner

Could any of the maintainers please take a look at this?

misberner avatar Aug 11 '22 20:08 misberner

@bulletmys @GoWebProd would it be possible to take a look at this PR?

misberner avatar Oct 24 '22 22:10 misberner

@gobwas any chance you could look at this?

misberner avatar Nov 02 '22 18:11 misberner