You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unquote interprets s as a single-quoted, double-quoted, or backquoted Go string literal, returning the string value that s quotes.
I understand "backquoted Go string literal" to mean what the Go spec calls a "raw string literal". Also, according to the Go spec:
Carriage return characters ('\r') inside raw string literals are discarded from the raw string value.
However, it seems that strconv.Unquote keeps carriage return characters rather than discarding them: https://play.golang.org/p/G-4x0-Mdop (Note that the \r escape sequence is interpreted by the Go interpreted string literal, so the string value seen by strconv.Unquote is the three byte sequence: GRAVE ACCENT, CARRIAGE RETURN, GRAVE ACCENT.)
It may be too late to change strconv.Unquote's behavior, but perhaps the existing behavior can be better documented at least.
The text was updated successfully, but these errors were encountered:
Package strconv says:
I understand "backquoted Go string literal" to mean what the Go spec calls a "raw string literal". Also, according to the Go spec:
However, it seems that strconv.Unquote keeps carriage return characters rather than discarding them: https://play.golang.org/p/G-4x0-Mdop (Note that the
\r
escape sequence is interpreted by the Go interpreted string literal, so the string value seen by strconv.Unquote is the three byte sequence: GRAVE ACCENT, CARRIAGE RETURN, GRAVE ACCENT.)It may be too late to change strconv.Unquote's behavior, but perhaps the existing behavior can be better documented at least.
The text was updated successfully, but these errors were encountered: