File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -56,11 +56,15 @@ func IsInvalidLengthError(err error) bool {
56
56
return ok
57
57
}
58
58
59
- // Parse decodes s into a UUID or returns an error. Both the standard UUID
60
- // forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and
61
- // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the
62
- // Microsoft encoding {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} and the raw hex
63
- // encoding: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
59
+ // Parse decodes s into a UUID or returns an error if it cannot be parsed. Both
60
+ // the standard UUID forms defined in RFC 4122
61
+ // (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and
62
+ // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) are decoded. In addition,
63
+ // Parse accepts non-standard strings such as the raw hex encoding
64
+ // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx and 38 byte "Microsoft style" encodings,
65
+ // e.g. {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. Only the middle 36 bytes are
66
+ // examined in the latter case. Parse should not be used to validate strings as
67
+ // it parses non-standard encodings as indicated above.
64
68
func Parse (s string ) (UUID , error ) {
65
69
var uuid UUID
66
70
switch len (s ) {
You can’t perform that action at this time.
0 commit comments