Skip to content

Commit

Permalink
Rename expr.CompileFieldExprArray to CompileFieldExprs (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwt authored Mar 6, 2020
1 parent e34ca3b commit 41e5c88
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion expr/fieldexpr.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ outer:
}, nil
}

func CompileFieldExprArray(nodes []ast.FieldExpr) ([]FieldExprResolver, error) {
// CompileFieldExprs calls CompileFieldExpr for each element of nodes.
func CompileFieldExprs(nodes []ast.FieldExpr) ([]FieldExprResolver, error) {
var resolvers []FieldExprResolver
if nodes != nil {
resolvers = make([]FieldExprResolver, 0, len(nodes))
Expand Down
2 changes: 1 addition & 1 deletion proc/cut.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Cut struct {
// do this now since it might confuse users who expect to see output
// fields in the order they specified.
func CompileCutProc(c *Context, parent Proc, node *ast.CutProc) (*Cut, error) {
resolvers, err := expr.CompileFieldExprArray(node.Fields)
resolvers, err := expr.CompileFieldExprs(node.Fields)
if err != nil {
return nil, fmt.Errorf("compiling cut: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions proc/proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func CompileProc(custom Compiler, node ast.Proc, c *Context, parent Proc) ([]Pro
return []Proc{cut}, nil

case *ast.SortProc:
fields, err := expr.CompileFieldExprArray(v.Fields)
fields, err := expr.CompileFieldExprs(v.Fields)
if err != nil {
return nil, fmt.Errorf("compiling sort: %w", err)
}
Expand Down Expand Up @@ -186,7 +186,7 @@ func CompileProc(custom Compiler, node ast.Proc, c *Context, parent Proc) ([]Pro
return []Proc{NewFilter(c, parent, f)}, nil

case *ast.TopProc:
fields, err := expr.CompileFieldExprArray(v.Fields)
fields, err := expr.CompileFieldExprs(v.Fields)
if err != nil {
return nil, fmt.Errorf("compiling top: %w", err)
}
Expand Down

0 comments on commit 41e5c88

Please sign in to comment.