Spelling, simplification, and effective if improvements (#339)
diff --git a/cel/env.go b/cel/env.go
index b1ae0b2..0919191 100644
--- a/cel/env.go
+++ b/cel/env.go
@@ -105,7 +105,7 @@
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 c4a6ea7..5d24d83 100644
--- a/examples/simple_test.go
+++ b/examples/simple_test.go
@@ -34,9 +34,15 @@
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 d3fde73..57c1713 100644
--- a/interpreter/attribute_patterns_test.go
+++ b/interpreter/attribute_patterns_test.go
@@ -296,7 +296,7 @@
// 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 333926d..3438b60 100644
--- a/interpreter/interpreter_test.go
+++ b/interpreter/interpreter_test.go
@@ -382,7 +382,7 @@
"pb2": &proto2pb.TestAllTypes{
RepeatedBool: []bool{false},
MapInt64NestedType: map[int64]*proto2pb.NestedTestAllTypes{
- 1: &proto2pb.NestedTestAllTypes{},
+ 1: {},
},
MapStringString: map[string]string{},
},
@@ -409,7 +409,7 @@
"pb3": &proto3pb.TestAllTypes{
RepeatedBool: []bool{false},
MapInt64NestedType: map[int64]*proto3pb.NestedTestAllTypes{
- 1: &proto3pb.NestedTestAllTypes{},
+ 1: {},
},
MapStringString: map[string]string{},
},