We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go version
$ go version go version go1.13.4 darwin/amd64
package main import ( "fmt" "strings" ) var PrefixTagSortKey = "v1:ts:" func main() { str := PrefixTagSortKey + "t" v := strings.TrimLeft(str, PrefixTagSortKey) fmt.Println(v) }
go env
mac os
go run
t
empty
The text was updated successfully, but these errors were encountered:
Hi,
The second parameter of TrimLeft is a cutset, meaning that (from the documentation):
TrimLeft
all leading Unicode code points contained in cutset [are] removed.
If the cutset is "v1:ts:", every single v, 1, :, t, and s character in the string will be removed.
"v1:ts:"
v
1
:
s
You probably want TrimPrefix
TrimPrefix
To remove a prefix, use TrimPrefix instead.
Closing here, since this is working as intended.
Sorry, something went wrong.
Thanks your explain.
No branches or pull requests
What version of Go are you using (
go version
)?CODE
What operating system and processor architecture are you using (
go env
)?mac os
What did you do?
go run
What did you expect to see?
t
What did you see instead?
empty
The text was updated successfully, but these errors were encountered: