Value implements the [database/sql/driver.Valuer] interface.
()
| 50 | |
| 51 | // Value implements the [database/sql/driver.Valuer] interface. |
| 52 | func (src Bits) Value() (driver.Value, error) { |
| 53 | if !src.Valid { |
| 54 | return nil, nil |
| 55 | } |
| 56 | |
| 57 | buf, err := BitsCodec{}.PlanEncode(nil, 0, TextFormatCode, src).Encode(src, nil) |
| 58 | if err != nil { |
| 59 | return nil, err |
| 60 | } |
| 61 | return string(buf), err |
| 62 | } |
| 63 | |
| 64 | type BitsCodec struct{} |
| 65 |
nothing calls this directly
no test coverage detected