You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JSON package uses structure tags to allow the user to define names for the JSON
fields that differ from those in the Go struct. The protocol buffer uses tags for a
different purpose. If one wants to use JSON to marshal a value achieved from a protocol
buffer, things go south; one gets badly formed names.
The protocol buffer code introduced the format "PB(...)" for its tags. We
could extend that convention with JSON, saying (perhaps) that "JSON(XXX)" is
the way to define a renaming.
In any case, JSON should certainly not use a tag that isn't an identifier. This would
be a simple step that avoids the most obvious collision.
The text was updated successfully, but these errors were encountered:
They don't need to be more complex. All I'm asking, at least for now, is a sanity
check, which should be very cheap.
JSON's implementation could be smarter, too. It's heavily reflection-driven but there
are ways to do better if it becomes important.
The text was updated successfully, but these errors were encountered: