You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, was digging around trying to learn more about the gojq query AST type and noticed panics for some queries when I tried to print them using log.Printf("var: %#+v\n", var) (the lv snippet in vscode). The panic happens because the expression has no operator and panics in func (Operator) String().
Example:
package main
import (
"log""github.com/itchyny/gojq"
)
funcmain() {
q, err:=gojq.Parse("a")
iferr!=nil {
panic(err)
}
log.Printf("q: %#+v\n", q)
}
Would it make sense that queries that parses successfully should be formattable like this? but I understand the panic make sense to have also. Maybe a new operator enum OpNone etc?
The text was updated successfully, but these errors were encountered:
The issue is about func (Operator) GoString(), not func (Operator) String(). Adding new operator for zero value is not a good solution as a workaround for debugging purpose.
Hi, was digging around trying to learn more about the gojq query AST type and noticed panics for some queries when I tried to print them using
log.Printf("var: %#+v\n", var)
(thelv
snippet in vscode). The panic happens because the expression has no operator and panics infunc (Operator) String()
.Example:
Would it make sense that queries that parses successfully should be formattable like this? but I understand the panic make sense to have also. Maybe a new operator enum
OpNone
etc?The text was updated successfully, but these errors were encountered: