diff --git a/cel/env.go b/cel/env.go index b1ae0b22..09191915 100644 --- a/cel/env.go +++ b/cel/env.go @@ -105,7 +105,7 @@ func NewEnv(opts ...EnvOption) (*Env, error) { return NewCustomEnv(stdOpts...) } -// NewCustomEnv creates a custom program enviroment which is not automatically configured with the +// NewCustomEnv creates a custom program environment which is not automatically configured with the // standard library of functions and macros documented in the CEL spec. // // The purpose for using a custom environment might be for subsetting the standard library produced diff --git a/examples/simple_test.go b/examples/simple_test.go index c4a6ea71..5d24d833 100644 --- a/examples/simple_test.go +++ b/examples/simple_test.go @@ -34,9 +34,15 @@ func ExampleSimple() { log.Fatalln(iss.Err()) } prg, err := env.Program(ast) + if err != nil { + log.Fatalln(err) + } out, _, err := prg.Eval(map[string]interface{}{ "name": "CEL", }) + if err != nil { + log.Fatalln(err) + } fmt.Println(out) // Output:Hello world! I'm CEL. } diff --git a/interpreter/attribute_patterns_test.go b/interpreter/attribute_patterns_test.go index d3fde736..57c1713e 100644 --- a/interpreter/attribute_patterns_test.go +++ b/interpreter/attribute_patterns_test.go @@ -296,7 +296,7 @@ func TestAttributePattern_CrossReference(t *testing.T) { // Qualify a[b] with 'c', a[b].c c, _ := fac.NewQualifier(nil, 3, "c") a.AddQualifier(c) - // The resolve step should return unkonwn + // The resolve step should return unknown val, err = a.Resolve(partVars) if err != nil { t.Fatal(err) diff --git a/interpreter/interpreter_test.go b/interpreter/interpreter_test.go index 333926d1..3438b609 100644 --- a/interpreter/interpreter_test.go +++ b/interpreter/interpreter_test.go @@ -382,7 +382,7 @@ var ( "pb2": &proto2pb.TestAllTypes{ RepeatedBool: []bool{false}, MapInt64NestedType: map[int64]*proto2pb.NestedTestAllTypes{ - 1: &proto2pb.NestedTestAllTypes{}, + 1: {}, }, MapStringString: map[string]string{}, }, @@ -409,7 +409,7 @@ var ( "pb3": &proto3pb.TestAllTypes{ RepeatedBool: []bool{false}, MapInt64NestedType: map[int64]*proto3pb.NestedTestAllTypes{ - 1: &proto3pb.NestedTestAllTypes{}, + 1: {}, }, MapStringString: map[string]string{}, },