A Go library for querying JSON data with a simple expression syntax, making JSON parsing and type assertion easier.
gojq is a Go library for querying JSON data using simple expressions, similar to jq but implemented natively in Go. It allows developers to extract specific values from JSON objects and arrays without complex manual parsing or type assertions, making it ideal for handling JSON configuration files and dynamic data structures.
Go developers who need to parse, query, or extract data from JSON in applications, especially those working with configuration files, APIs, or nested JSON structures.
It provides a clean, minimal API for JSON querying that reduces boilerplate code and simplifies error handling compared to standard Go JSON unmarshaling, with no external dependencies.
JSON query in Golang
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses intuitive dot notation and array indexing for easy data extraction, as shown in examples like `parser.Query('name')` and `parser.Query('skills.[1]')` in the README.
Returns nil for missing fields without panicking, demonstrated with `parser.Query('hello')` returning an error for non-existent keys, simplifying error management.
Can parse JSON from strings or existing Go objects via `NewStringQuery` and `NewQuery`, allowing use with various data sources without additional setup.
No external dependencies and easy installation via `go get`, making it a minimal addition to Go projects, as stated in the README.
Lacks advanced features like filtering, functions, or conditionals compared to full jq, restricting it to basic extraction tasks as evidenced by the simple syntax examples.
Error messages are simplistic, such as 'does not exist' in the README examples, which may not provide enough detail for debugging complex queries or edge cases.
Only provides basic examples in the README without comprehensive API documentation, tutorials, or guidance for advanced usage, limiting learning resources.