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

Method decodePlain

postgres/parser/uuid/codec.go:212–221  ·  view source on GitHub ↗

decodePlain decodes UUID strings that are using the following formats: "6ba7b810-9dad-11d1-80b4-00c04fd430c8" or in hash-like format "6ba7b8109dad11d180b400c04fd430c8".

(t []byte)

Source from the content-addressed store, hash-verified

210// "6ba7b810-9dad-11d1-80b4-00c04fd430c8" or in hash-like format
211// "6ba7b8109dad11d180b400c04fd430c8".
212func (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.
224func (u UUID) MarshalBinary() ([]byte, error) {

Callers 2

decodeBracedMethod · 0.95
decodeURNMethod · 0.95

Calls 3

decodeHashLikeMethod · 0.95
decodeCanonicalMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected