Expression language and expression evaluation for Go
expr-lang/epxr
⚠️expr.WithContext()
option to pass context to custom functions.vm.Program
.ceil()
, floor()
and round()
function.$env
sort()
built-in??
operatorOpEqual{Int,String}
for simple typesOpDeref
(#467)ast.Node
type now is not copied with ast.Patch
42 in ["a"]
as invalid.uint32
func argument types in AST (#438)in
operator.Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.
let foo = filter(tweets, .Text contains "foo");
let name = foo?.Author?.Name ?? "unknown";
upper(name)
len(filter())
and map(filter())
filter()[0]
and filter()[-1]
sort
, sortBy
groupBy
toPairs
, fromPairs
take
, reduce
, mean
, median
.tweets | filter(.Size < 280) | map(.Content) | join(" -- ")
filter(posts, {
let span = now() - .CreatedAt;
let limit = 7 * duration("24h");
span >= limit
})
String()
with omitted from or to fields.ast.String()
to nodes.keys()
, values()
and type()
builtins.expr.DisableBuiltin()
.