Skip to content
New issue

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

x/pkgsite: LeftTrim example is not clear #53772

Closed
monkrus opened this issue Jul 10, 2022 · 1 comment
Closed

x/pkgsite: LeftTrim example is not clear #53772

monkrus opened this issue Jul 10, 2022 · 1 comment

Comments

@monkrus
Copy link

monkrus commented Jul 10, 2022

What is the URL of the page with the issue?

https://pkg.go.dev/strings#TrimLeft

What is your user agent?

Chrome
Version 103.0.5060.114 (Official Build) (64-bit)

Screenshot

image

What did you do?

Click on run


import (
	"fmt"
	"strings"
)

func main() {
	fmt.Print(strings.TrimLeft("¡¡¡Hello, Gophers!!!", "!¡"))
}

Run an example

What did you expect to see?

fmt.Print(strings.TrimLeft("¡¡¡Hello, Gophers!!!", "¡"))

What did you see instead?

fmt.Print(strings.TrimLeft("¡¡¡Hello, Gophers!!!", "!¡"))

@gopherbot gopherbot added this to the Unreleased milestone Jul 10, 2022
@seankhliao
Copy link
Member

The example is there to show that from the given cutset, only those matching on the left will be removed. just "¡" wouldn't be clear on what happens if ¡ appears elsewhere, eg on the right.

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2022
@golang golang locked and limited conversation to collaborators Jul 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants