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
According to the readme, you can define an array in gval:
Json Arrays : [1, 2, "foo"]
And you can look up an element from an array:
Map and array elements and Struct Field can be accessed via []. foo[0]
Then I should be able to define an array and look up an element:
[10,11,12,13][2]
I expected this to return 12, but instead I got:
12
&errors.errorString{s:"parsing error: [10,11,12,13][2]\t:1:14 - 1:15 unexpected \"[\" while scanning operator"}
What I'm trying to do is let a customer define an array in a gval string, and input from their user will be used to look up an element:
["foo", "bar", ...][x]
Where "foo", "bar", ... is written by an admin, and x comes from an end user.
"foo", "bar", ...
x
The text was updated successfully, but these errors were encountered:
Yes the VariableSelector is currently fixed tied to variables. That is the reason why [10,11,12,13][2] can't be parsed.
The VariableSelector could instead be implemented as a PostfixOperator.
Sorry, something went wrong.
Makes sense. I would appreciate a fix for this. 🙂
I can do this but it will take some time.
No branches or pull requests
According to the readme, you can define an array in gval:
And you can look up an element from an array:
Then I should be able to define an array and look up an element:
I expected this to return
12
, but instead I got:What I'm trying to do is let a customer define an array in a gval string, and input from their user will be used to look up an element:
Where
"foo", "bar", ...
is written by an admin, andx
comes from an end user.The text was updated successfully, but these errors were encountered: