encodeUUID converts a uuid byte array to UUID standard string form.
(src [16]byte)
| 54 | |
| 55 | // encodeUUID converts a uuid byte array to UUID standard string form. |
| 56 | func encodeUUID(src [16]byte) string { |
| 57 | var buf [36]byte |
| 58 | |
| 59 | hex.Encode(buf[0:8], src[:4]) |
| 60 | buf[8] = '-' |
| 61 | hex.Encode(buf[9:13], src[4:6]) |
| 62 | buf[13] = '-' |
| 63 | hex.Encode(buf[14:18], src[6:8]) |
| 64 | buf[18] = '-' |
| 65 | hex.Encode(buf[19:23], src[8:10]) |
| 66 | buf[23] = '-' |
| 67 | hex.Encode(buf[24:], src[10:]) |
| 68 | |
| 69 | return string(buf[:]) |
| 70 | } |
| 71 | |
| 72 | // Scan implements the [database/sql.Scanner] interface. |
| 73 | func (dst *UUID) Scan(src any) error { |
no test coverage detected