easyjson
easyjson copied to clipboard
json.Valid breaks in SkipRecursive
Hi. I am writing ETL programs, and sometimes I just need to pass big JSONs through my program:
//easyjson:json
type JSONRPCResponse struct {
JSONRPC string `json:"jsonrpc"`
ID string `json:"id"`
Result easyjson.RawMessage `json:"result,omitempty"`
Error easyjson.RawMessage `json:"error,omitempty"`
}
I don't care about what's inside Result
or Error
, but I need to pass them to stdout later. In the debugger, I see unnecessary (for me) json.Valid
calls:
Here https://github.com/mailru/easyjson/blob/master/jlexer/lexer.go#L558
monkey.Patch(json.Valid, func(data []byte) bool { return true })
It helps, but... Perhaps adding an option to disable this check would be helpful, or am I doing something unusual?