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
Hi,
Using two selectors in comparison expression doesn't seem to work.
This works:
"value.nomad == test and value.consul == test",
This doesn't:
"value.nomad == value.consul",
The following code shows the problem:
package main import ( "fmt" "os" "github.com/hashicorp/go-bexpr" "github.com/hashicorp/go-bexpr/grammar" ) type Example struct { Nomad string `bexpr:"nomad"` Consul string `bexpr:"consul"` } func main() { value := map[string]Example{ "value": {Nomad: "prueba", Consul: "prueba"}, } expressions := []string{ "value.nomad == prueba and value.consul == prueba", "value.nomad == value.consul", } for _, expression := range expressions { eval, err := bexpr.CreateEvaluator(expression) if err != nil { fmt.Printf("Failed to create evaluator for expression %q: %v\n", expression, err) continue } result, err := eval.Evaluate(value) if err != nil { fmt.Printf("Failed to run evaluation of expression %q: %v\n", expression, err) continue } fmt.Printf("Result of expression %q evaluation: %t\n", expression, result) } }
I guess this is not implemented. Is there any way I can get this working? Thanks
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
Using two selectors in comparison expression doesn't seem to work.
This works:
This doesn't:
The following code shows the problem:
I guess this is not implemented. Is there any way I can get this working? Thanks
The text was updated successfully, but these errors were encountered: