Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json.Valid breaks in SkipRecursive #387

Open
alexesDev opened this issue Jun 15, 2023 · 0 comments
Open

json.Valid breaks in SkipRecursive #387

alexesDev opened this issue Jun 15, 2023 · 0 comments

Comments

@alexesDev
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant