Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add coll.JQ using gojq library #1585
Add coll.JQ using gojq library #1585
Changes from 7 commits
76ae022
d4931ba
4828db1
d627ef5
c3ff3d4
e5f3b16
6e7a093
6c0701b
db8f0c2
ce7c606
5b50110
a3a57e7
97946ab
1f4818c
e7f569b
600790b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔
I suppose this is because JQ can't be used with arbitrary structs or other types, which is perhaps something we should allow...
In the same vein, it might be useful to be able to pass the template context (
gomplate.tmplctx
) as the input for something like:$ gomplate -c books=https://openlibrary.org/subjects/fantasy.json -i '{{ jq `.works[].title` . }}'
Right now this fails with:
What's interesting in that particular case is that
gomplate.tmplctx
is amap[string]interface{}
, which is in theory OK.I'm going to hack on this a bit and make a commit if I can figure It out...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've gotten this to work:
Note that I've referenced the
books
datasource in the.
context passed through as an argument.