Skip to content

Commit

Permalink
Spelling, simplification, and effective if improvements (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
TristonianJones authored Apr 21, 2020
1 parent 6334ad3 commit 33f7127
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cel/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions examples/simple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
2 changes: 1 addition & 1 deletion interpreter/attribute_patterns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions interpreter/interpreter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ var (
"pb2": &proto2pb.TestAllTypes{
RepeatedBool: []bool{false},
MapInt64NestedType: map[int64]*proto2pb.NestedTestAllTypes{
1: &proto2pb.NestedTestAllTypes{},
1: {},
},
MapStringString: map[string]string{},
},
Expand All @@ -409,7 +409,7 @@ var (
"pb3": &proto3pb.TestAllTypes{
RepeatedBool: []bool{false},
MapInt64NestedType: map[int64]*proto3pb.NestedTestAllTypes{
1: &proto3pb.NestedTestAllTypes{},
1: {},
},
MapStringString: map[string]string{},
},
Expand Down

0 comments on commit 33f7127

Please sign in to comment.