Scan satisfies the sql.Scanner interface.
(v any)
| 183 | |
| 184 | // Scan satisfies the sql.Scanner interface. |
| 185 | func (t *Time) Scan(v any) error { |
| 186 | switch x := v.(type) { |
| 187 | case time.Time: |
| 188 | t.time = x |
| 189 | return nil |
| 190 | case []byte: |
| 191 | return t.Parse(string(x)) |
| 192 | case string: |
| 193 | return t.Parse(x) |
| 194 | } |
| 195 | return ErrInvalidTime(fmt.Sprintf("%T", v)) |
| 196 | } |
| 197 | |
| 198 | // Parse attempts to Parse string s to t. |
| 199 | func (t *Time) Parse(s string) error { |
no test coverage detected