decodePlain decodes UUID strings that are using the following formats: "6ba7b810-9dad-11d1-80b4-00c04fd430c8" or in hash-like format "6ba7b8109dad11d180b400c04fd430c8".
(t []byte)
| 210 | // "6ba7b810-9dad-11d1-80b4-00c04fd430c8" or in hash-like format |
| 211 | // "6ba7b8109dad11d180b400c04fd430c8". |
| 212 | func (u *UUID) decodePlain(t []byte) error { |
| 213 | switch len(t) { |
| 214 | case 32: |
| 215 | return u.decodeHashLike(t) |
| 216 | case 36: |
| 217 | return u.decodeCanonical(t) |
| 218 | default: |
| 219 | return fmt.Errorf("uuid: incorrrect UUID length: %s", t) |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | // MarshalBinary implements the encoding.BinaryMarshaler interface. |
| 224 | func (u UUID) MarshalBinary() ([]byte, error) { |
no test coverage detected