-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
1.10.2
Does this issue reproduce with the latest release?
N/A
What operating system and processor architecture are you using (go env)?
N/A
What did you do?
Looked at the godoc for PathUnescape
What did you expect to see?
PathUnescape does the inverse transformation of PathEscape, converting each 3-byte encoded substring of the form "%AB" into the hex-decoded byte 0xAB. It returns an error if any % is not followed by two hexadecimal digits.
PathUnescape is identical to QueryUnescape except that it does not unescape '+' to ' ' (space).
What did you see instead?
PathUnescape does the inverse transformation of PathEscape, converting each 3-byte encoded substring of the form "%AB" into the hex-decoded byte 0xAB. It also converts '+' into ' ' (space). It returns an error if any % is not followed by two hexadecimal digits.
PathUnescape is identical to QueryUnescape except that it does not unescape '+' to ' ' (space).
Commentary
It seems like the documentation for PathUnescape was copied from QueryUnescape, with the last line added. However, it then contradicts itself about its behavior with + characters.
Fix
Remove the line It also converts '+' into ' ' (space). from the PathUnescape comment. I would submit a PR but the amount of hoops I'd have to jump through to contribute one line of code is a little much; I'd like to ask that someone who's already set up as Go contributor take care of this.
Thanks!