From 41e5c889e8c59a842446c4fb9394280f77945194 Mon Sep 17 00:00:00 2001 From: Noah Treuhaft Date: Thu, 5 Mar 2020 19:43:37 -0800 Subject: [PATCH] Rename expr.CompileFieldExprArray to CompileFieldExprs (#392) --- expr/fieldexpr.go | 3 ++- proc/cut.go | 2 +- proc/proc.go | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/expr/fieldexpr.go b/expr/fieldexpr.go index 5f85974873..3001aa80a0 100644 --- a/expr/fieldexpr.go +++ b/expr/fieldexpr.go @@ -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)) diff --git a/proc/cut.go b/proc/cut.go index e3cc681f77..7441cf77f6 100644 --- a/proc/cut.go +++ b/proc/cut.go @@ -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) } diff --git a/proc/proc.go b/proc/proc.go index 70893ed192..e09030779d 100644 --- a/proc/proc.go +++ b/proc/proc.go @@ -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) } @@ -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) }