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
One implementation approach that might be interesting would be storing a []Token, in contrast to json.RawMessage's []byte approach. This would save tokenizing twice, assuming you're going to parse it later. On the other hand, the memory overhead might not be great; the token type is defined with a ton of fields and expected to be used like a union, because the way things work right now there's only ever one of the allocated and it's just used to pass messages back and forth. So, maybe it depends on what you're doing.
If you're angling to do something like http://eagain.net/articles/go-json-kind/ with this, there might be other options: docs/dev/code-layout.md proposed things like unmarshalMachinePolymorphicEnvelope, which also still needs implementation work, but would probably be the cleanest solution to those sorts of use case.
I basically want the equivalent of https://golang.org/pkg/encoding/json/#RawMessage
I can look at implementing this if its not already possible.
The text was updated successfully, but these errors were encountered: