(val super.Value)
| 107 | } |
| 108 | |
| 109 | func newBufferFilterForLiteral(val super.Value) (*expr.BufferFilter, error) { |
| 110 | if id := val.Type().ID(); super.IsNumber(id) || id == super.IDNull { |
| 111 | // All numbers are comparable, so they can require up to three |
| 112 | // patterns: float, varint, and uvarint. |
| 113 | return nil, nil |
| 114 | } |
| 115 | // We're looking for a complete BSUP value, so we can lengthen the |
| 116 | // pattern by calling Encode to add a tag. |
| 117 | pattern := string(val.Encode(nil)) |
| 118 | return expr.NewBufferFilterForString(pattern), nil |
| 119 | } |
no test coverage detected