easyjson icon indicating copy to clipboard operation
easyjson copied to clipboard

json.Valid breaks in SkipRecursive

Open alexesDev opened this issue 1 year ago • 0 comments

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: image 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?

alexesDev avatar Jun 15 '23 22:06 alexesDev