tidwall/gjson ? reverse-engineered prompt

Reverse engineered prompt

Build me a really fast and simple Go library for getting data out of JSON. I don't want to have to deal with unmarshalling an entire JSON object into a struct just to get one or two values.

The main feature is that I should be able to get a value with a single function call by providing a path. For example, I could use a string like "name.last" to get a nested value, or "children.1" to get the second item in an array. It should also support wildcards in the path.

It would be great if it could handle more advanced queries, like searching an array for an object where a field matches a certain value. Also, add some utility functions, like one to reverse an array or another one to pretty-print the JSON. The main goal is performance and a very simple, one-line API for most common cases.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab