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

affected/package: strings #62677

Closed
VarusHsu opened this issue Sep 16, 2023 · 2 comments
Closed

affected/package: strings #62677

VarusHsu opened this issue Sep 16, 2023 · 2 comments

Comments

@VarusHsu
Copy link

Is there a wrong comment about strings.TrimSpace ?

What version of Go are you using (go version)?

go 1.21

$ go version
go 1.21

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

MacOS

go env Output

It's not a bug but maybe it will misslead golang newer.

// TrimSpace returns a slice of the string s, with all leading
// and trailing white space removed, as defined by Unicode.
func TrimSpace(s string) string {
@seankhliao
Copy link
Member

it's a necessary detail as it means both strings will reference the same backing array (important in deciding if it can be gc'ed)

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 2023
@VarusHsu
Copy link
Author

@seankhliao Oh Thanks, after your answer. I suddenly understand what author want to explain.

@golang golang locked and limited conversation to collaborators Sep 15, 2024
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