NewScanner returns a Scanner for r that filters records by filterExpr and s. If r implements fmt.Stringer, the scanner reports errors using a prefix of the string returned by its String method.
(ctx context.Context, r sio.Reader, filterExpr Pushdown)
| 37 | // If r implements fmt.Stringer, the scanner reports errors using a prefix of the |
| 38 | // string returned by its String method. |
| 39 | func NewScanner(ctx context.Context, r sio.Reader, filterExpr Pushdown) (Scanner, error) { |
| 40 | s, err := newScanner(ctx, r, filterExpr) |
| 41 | if err != nil { |
| 42 | return nil, err |
| 43 | } |
| 44 | if stringer, ok := r.(fmt.Stringer); ok { |
| 45 | s = NamedScanner(s, stringer.String()) |
| 46 | } |
| 47 | return s, nil |
| 48 | } |
| 49 | |
| 50 | func newScanner(ctx context.Context, r sio.Reader, filterExpr Pushdown) (Scanner, error) { |
| 51 | var sa ScannerAble |
no test coverage detected