Scan satisfies the driver.Scanner interface
(v interface{})
| 90 | |
| 91 | // Scan satisfies the driver.Scanner interface |
| 92 | func (h *Hash) Scan(v interface{}) error { |
| 93 | var buf [32]byte |
| 94 | b, ok := v.([]byte) |
| 95 | if !ok { |
| 96 | return fmt.Errorf("Hash.Scan received unsupported type %T", v) |
| 97 | } |
| 98 | copy(buf[:], b) |
| 99 | *h = NewHash(buf) |
| 100 | return nil |
| 101 | } |
| 102 | |
| 103 | // WriteTo satisfies the io.WriterTo interface. |
| 104 | func (h Hash) WriteTo(w io.Writer) (int64, error) { |