func (s *state) evalFunction(dot reflect.Value, node *expr.IdentityNode, cmd expr.Node, args []expr.Node, final reflect.Value) reflect.Value { name := node.Text function, ok := findFunction(name, s.tmpl) if !ok { return s.errorf("%q is not a defined function", name) } return s.evalCall(dot, f
(fieldName string)
| 106 | // } |
| 107 | |
| 108 | func lowerFieldMatch(fieldName string) func(string) bool { |
| 109 | lowerField := strings.ToLower(fieldName) |
| 110 | return func(field string) bool { |
| 111 | //u.Debugf("check: %s == %s ?", field, lowerField) |
| 112 | return strings.ToLower(field) == lowerField |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | // evalField evaluates an expression like (.Field) or (.Field arg1 arg2). |
| 117 | // The 'final' argument represents the return value from the preceding |