MCPcopy Create free account
hub / github.com/dolthub/doltgresql / decodeURN

Method decodeURN

postgres/parser/uuid/codec.go:196–206  ·  view source on GitHub ↗

decodeURN decodes UUID strings that are using the following formats: "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" "urn:uuid:6ba7b8109dad11d180b400c04fd430c8".

(t []byte)

Source from the content-addressed store, hash-verified

194// "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8"
195// "urn:uuid:6ba7b8109dad11d180b400c04fd430c8".
196func (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//

Callers 1

UnmarshalTextMethod · 0.95

Calls 3

decodePlainMethod · 0.95
ErrorfMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected