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
fromJSON
The current fromJSON function only supports parameters of type string. If I pass a parameter of type *string, it throws an error.
The text was updated successfully, but these errors were encountered:
Looks like a deref is missing. Could you please share the whole example?
Sorry, something went wrong.
Looks like a deref is missing. Could you please share the whole example?看起来缺少 deref。您能分享整个示例吗?
sure!
package main import ( "fmt" "github.com/expr-lang/expr" ) func main() { jsonString := `{"Num": 1}` env := map[string]any{ "aJSONString": &jsonString, } code := "fromJSON(aJSONString)" result, err := expr.Eval(code, env) if err != nil { panic(err) } fmt.Println(result) }
panic: interface conversion: interface {} is *string, not string (1:1) | fromJSON(aJSONString) | ^ goroutine 1 [running]:
and split
split
No branches or pull requests
The current
fromJSON
function only supports parameters of type string. If I pass a parameter of type *string, it throws an error.The text was updated successfully, but these errors were encountered: