Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
Migrate from interface{} -> any (google#590)
Browse files Browse the repository at this point in the history
* Migrate from interface{} -> any
* Migrate examples from interface{} to any
  • Loading branch information
TristonianJones authored Sep 22, 2022
1 parent 1b994e0 commit 377a0bb
Show file tree
Hide file tree
Showing 71 changed files with 745 additions and 747 deletions.
6 changes: 3 additions & 3 deletions cel/cel_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func Example() {
}

// Evaluate the program against some inputs. Note: the details return is not used.
out, _, err := prg.Eval(map[string]interface{}{
out, _, err := prg.Eval(map[string]any{
// Native values are converted to CEL values under the covers.
"i": "CEL",
// Values may also be lazily supplied.
Expand Down Expand Up @@ -107,7 +107,7 @@ func Example_globalOverload() {
}

// Evaluate the program against some inputs. Note: the details return is not used.
out, _, err := prg.Eval(map[string]interface{}{
out, _, err := prg.Eval(map[string]any{
"i": "CEL",
"you": func() ref.Val { return types.String("world") },
})
Expand All @@ -122,7 +122,7 @@ func Example_globalOverload() {
func Example_statefulOverload() {
// makeFetch produces a consistent function signature with a different function
// implementation depending on the provided context.
makeFetch := func(ctx interface{}) cel.EnvOption {
makeFetch := func(ctx any) cel.EnvOption {
fn := func(arg ref.Val) ref.Val {
return types.NewErr("stateful context not bound")
}
Expand Down
Loading

0 comments on commit 377a0bb

Please sign in to comment.