We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b02ec3 commit f3d5649Copy full SHA for f3d5649
1 file changed
internal/commands/jq.go
@@ -18,15 +18,11 @@ type jqWriter struct {
18
}
19
20
// newJQWriter parses and compiles the jq expression and returns a filtering writer.
21
-// Compilation includes gojq.WithEnvironLoader for env.VAR / $ENV.VAR access.
+// Delegates to compileJQ for compilation so options are maintained in one place.
22
func newJQWriter(dest io.Writer, filter string) (*jqWriter, error) {
23
- query, err := gojq.Parse(filter)
24
- if err != nil {
25
- return nil, errors.ErrJQValidation(err)
26
- }
27
- code, err := gojq.Compile(query, gojq.WithEnvironLoader(os.Environ))
+ code, err := compileJQ(filter)
28
if err != nil {
29
+ return nil, err
30
31
return &jqWriter{dest: dest, code: code}, nil
32
0 commit comments