package main
import (
"fmt""github.com/antonmedv/expr"
)
funcmain() {
env:=map[string]any{
"a": func() bool { fmt.Println("a executed"); returntrue },
"b": func() bool { fmt.Println("b executed"); returnfalse },
}
program, _:=expr.Compile(`a() || b()`, expr.Env(env))
_, _=expr.Run(program, env)
// Output:// a executed
}Output of above code will be a executed.
But I'm wondering if there's an option which I can pass to the expr, or something else I'can do to disable the shortcircuit effect.
After disabling shortcircuit, output will be a executed and b executed.
Output of above code will be
a executed.But I'm wondering if there's an option which I can pass to the expr, or something else I'can do to disable the shortcircuit effect.
After disabling shortcircuit, output will be
a executedandb executed.