{"id":"4520a31a15de01f7","repo":"jackc/pgx","slug":"cannot-parse-uuid-v","errorCode":null,"errorMessage":"cannot parse UUID %v","messagePattern":"cannot parse UUID (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/uuid.go","lineNumber":43,"sourceCode":"\t*b = v\n\treturn nil\n}\n\n// UUIDValue implements the [UUIDValuer] interface.\nfunc (b UUID) UUIDValue() (UUID, error) {\n\treturn b, nil\n}\n\n// parseUUID converts a string UUID in standard form to a byte array.\nfunc parseUUID(src string) (dst [16]byte, err error) {\n\tswitch len(src) {\n\tcase 36:\n\t\tsrc = src[0:8] + src[9:13] + src[14:18] + src[19:23] + src[24:]\n\tcase 32:\n\t\t// dashes already stripped, assume valid\n\tdefault:\n\t\t// assume invalid.\n\t\treturn dst, fmt.Errorf(\"cannot parse UUID %v\", src)\n\t}\n\n\tbuf, err := hex.DecodeString(src)\n\tif err != nil {\n\t\treturn dst, err\n\t}\n\n\tcopy(dst[:], buf)\n\treturn dst, err\n}\n\n// encodeUUID converts a uuid byte array to UUID standard string form.\nfunc encodeUUID(src [16]byte) string {\n\tvar buf [36]byte\n\n\thex.Encode(buf[0:8], src[:4])\n\tbuf[8] = '-'\n\thex.Encode(buf[9:13], src[4:6])","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/uuid.go#L25-L61","documentation":"Error \"cannot parse UUID %v\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/uuid.go:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","schemaVersion":2}