Skip to content
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

parameter not support map[int]int ? #22

Closed
zhangziang opened this issue Apr 18, 2019 · 5 comments
Closed

parameter not support map[int]int ? #22

zhangziang opened this issue Apr 18, 2019 · 5 comments
Labels

Comments

@zhangziang
Copy link

zhangziang commented Apr 18, 2019

The following code will panic

	value,err := gval.Evaluate(`a[0] + a[2]`, map[string]interface{}{
		"a":map[int]int{0:1,2:1},
	})
generikvault pushed a commit that referenced this issue Apr 18, 2019
@generikvault
Copy link
Collaborator

fixed it and added your example to the test cases

@zhangziang
Copy link
Author

@generikvault
If the map index‘s type is int32 or int64 or float32 …
will get a err.

@generikvault
Copy link
Collaborator

@zhangziang
Yes, sorry thats not supported yet. You can override the VariableSelector in your own project or extend the functionallity in gval via pull request.

@zhangziang
Copy link
Author

ok, thanks.
Is there some references can help me understand this project?

@generikvault
Copy link
Collaborator

There's is godoc with an enxample: https://godoc.org/github.com/PaesslerAG/gval#VariableSelector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants