We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Would it be possible to add an eval() function?
The text was updated successfully, but these errors were encountered:
Would you explain the use case? It evaluates some jq code constructed from the input JSON?
Sorry, something went wrong.
This is unlikely to be included until jq implements this.
Maybe useful for someone else:
func eval(c interface{}, a []interface{}) gojq.Iter { src, ok := a[0].(string) if !ok { return gojq.NewIter(fmt.Errorf("%v: src is not a string", a[0])) } gq, err := gojq.Parse(src) if err != nil { return gojq.NewIter(err) } gc, err := gojq.Compile( gq, p.CompilerOptions()..., ) if err != nil { return gojq.NewIter(err) } return gc.Run(c) } gojq.WithIterFunction("eval", 1, 1, eval)
Successfully merging a pull request may close this issue.
Would it be possible to add an eval() function?
The text was updated successfully, but these errors were encountered: