File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 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 {
5656 return ok
5757}
5858
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.
6468func Parse (s string ) (UUID , error ) {
6569 var uuid UUID
6670 switch len (s ) {
You can’t perform that action at this time.
0 commit comments