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 isn't a bug. The Go issue tracker is also not for questions, please use the mailing list.
TrimRight returns a slice of the string s, with all trailing Unicode code points contained in cutset removed.
The cutset .html contains the letter t in the trailing part of the string, therefore the trailing t in about is removed. For example, see that strings.TrimRight("abouta.html", ".html") produces abouta -- that's because a is not in the trailing set.
For your case, you should be using TrimPrefix NOT TrimRight.
go 1.8.1
macos 10.12.4
I got
abou
, NOTabout
on following codeAnd I try other cases on
strings.TrimRight()
, they are all OK.Why above case is failed? A bug?
The text was updated successfully, but these errors were encountered: