go-github<https://github.com/google/go-github>library where I'm unable
to set values to their zero value, since they are
defined with omitempty and they get dropped when marshalling the JSON (full
GitHub issue here <https://github.com/google/go-github/issues/19>). The
obvious answer seems to be to use pointers for my struct fields, especially
since that's what goprotobuf uses. My two questions are:
1) In my (certainly non-exhaustive) perusal of various go libraries, this
pattern does not seem to be very well adopted. Clearly, some of that may
be cases where there isn't a need to explicitly set a field to it's
zero-value. But certainly, I would have expected to see this more. Am I
just not looking in the right places, and this is more common than I think
2) If it is a more common pattern, would it make sense to promote
proto.String() and friends to a more general location? What are other
libraries doing for this (creating pointers to primitive types)? Are they
redefining those helper functions, importing goprotobuf just for those
helpers, not using helpers at all?
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
For more options, visit https://groups.google.com/groups/opt_out.