(args ...vector.Any)
| 235 | } |
| 236 | |
| 237 | func (t *Trim) Call(args ...vector.Any) vector.Any { |
| 238 | if vec, ok := expr.CheckForNullThenError(args); ok { |
| 239 | return vec |
| 240 | } |
| 241 | val := vector.Under(args[0]) |
| 242 | if val.Type() != super.TypeString { |
| 243 | return vector.NewWrappedError(t.sctx, "trim: string arg required", val) |
| 244 | } |
| 245 | out := vector.NewStringEmpty(val.Len()) |
| 246 | for i := uint32(0); i < val.Len(); i++ { |
| 247 | s := vector.StringValue(val, i) |
| 248 | out.Append(strings.TrimSpace(s)) |
| 249 | } |
| 250 | return out |
| 251 | } |
nothing calls this directly
no test coverage detected