are there any examples in github ?
--
You received this message because you are subscribed to the Google Groups "CEL Go Discussion Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cel-go-discus...@googlegroups.com.
To post to this group, send email to cel-go-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cel-go-discuss/009bb2fb-c636-40cc-bf2c-8fb381b3f6cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/cel-go-discuss/c8a6e93a-aae9-4396-b23c-7de194da7dc4%40googlegroups.com.
func TestInterpreter_TimestampDayOfTheWeek(t *testing.T) { expression := "timestamp(now).getDayOfWeek()" // no such overload expression = "timestamp(now).getDayOfWeek('UTC')" // no such overload // expression = `timestamp(now).getDayOfWeek` // type 'well_known:TIMESTAMP ' does not support field selection // expression = `getDayOfWeek(timestamp(now))` // found no matching overload for 'getDayOfWeek' applied to '(timestamp)' expr := compileExpr(t, expression, decls.NewIdent("now", decls.String, nil)) prog := NewCheckedProgram(expr) eval := interpreter.NewInterpretable(prog)
for now, expectedResult := range map[string]int{ "2018-12-18T01:00:00Z": 2, } { result, _ := eval.Eval(NewActivation(map[string]interface{}{ "now": now, })) if v, ok := result.Value().(int); !ok || v != expectedResult { t.Errorf("Got %v, wanted %v for expr %s with input %s", result.Value(), expectedResult, expression, now) } }}To view this discussion on the web visit https://groups.google.com/d/msgid/cel-go-discuss/9c99cc94-b916-4ad0-b90c-0e039b1cc6d1%40googlegroups.com.
Hello there,Apart from the README.md and the github.com/google/cel-spec there aren't a lot of examples at the moment. What would you like to see? I'd be happy to file an issue and update the docs.-Tristan
On Mon, Jun 4, 2018 at 1:06 PM <ged...@gmail.com> wrote:
are there any examples in github ?--
You received this message because you are subscribed to the Google Groups "CEL Go Discussion Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cel-go-...@googlegroups.com.