decodeURN decodes UUID strings that are using the following formats: "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" "urn:uuid:6ba7b8109dad11d180b400c04fd430c8".
(t []byte)
| 194 | // "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" |
| 195 | // "urn:uuid:6ba7b8109dad11d180b400c04fd430c8". |
| 196 | func (u *UUID) decodeURN(t []byte) error { |
| 197 | total := len(t) |
| 198 | |
| 199 | urnUUIDPrefix := t[:9] |
| 200 | |
| 201 | if !bytes.Equal(urnUUIDPrefix, urnPrefix) { |
| 202 | return fmt.Errorf("uuid: incorrect UUID format: %s", t) |
| 203 | } |
| 204 | |
| 205 | return u.decodePlain(t[9:total]) |
| 206 | } |
| 207 | |
| 208 | // decodePlain decodes UUID strings that are using the following formats: |
| 209 | // |
no test coverage detected