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
This bugs comes from using unicode.IsSpace, and Go's string slice counts its size as bytes, not as runes.
Package heredoc is used for writing raw string as heredoc-like, so it should follow Go language spec with respect to space character.
Go language spec says these characters are treated as space:
spaces U+0020
horizontal tabs U+0009
carriage returns U+000D
newlines U+000A
Newlines and carriage returns are known as newline character. As a conclusion, heredoc should treat only spaces and horizontal tabs as indent characters.
Describe the bug
Wrong character is produced by
heredoc.Doc
function when indent contains full-width (zenkaku, u+3000) space.To Reproduce
With:
Shows this result:
"\x80\x80hello"
."\x80"
is wrong character.Expected behavior
"hello"
is correct result.The text was updated successfully, but these errors were encountered: