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

strings: please improve documentation for strings.Builder #22778

Closed
jech opened this issue Nov 17, 2017 · 7 comments
Closed

strings: please improve documentation for strings.Builder #22778

jech opened this issue Nov 17, 2017 · 7 comments
Labels
Documentation FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@jech
Copy link

jech commented Nov 17, 2017

I think that the documentation of strings.Builder could be improved by adding a few sentences that compare it to bytes.Buffer. More exactly, I'd like to see:

  • a pointer to bytes.Buffer;
  • a list of the methods that strings.Builder is lacking as compared to bytes.Buffer.
@ALTree ALTree changed the title Please improve documentation for strings.Builder strings: please improve documentation for strings.Builder Nov 17, 2017
@bradfitz
Copy link
Contributor

We could do the first bullet, but I don't want to do the second bullet. That seems too verbose for its utility.

@bradfitz bradfitz added this to the Go1.10 milestone Nov 17, 2017
@bradfitz bradfitz added help wanted NeedsFix The path to resolution is known, but the work has not been done. labels Nov 17, 2017
@gopherbot
Copy link

Change https://golang.org/cl/78696 mentions this issue: strings: Add a note on bytes.Buffer

@jech
Copy link
Author

jech commented Nov 19, 2017

You could at least mention that Builder lacks the Bytes method, which is the main point as far as I understand.

@MateusAmin
Copy link

I have read through the relevant discussions/changes/sources and would be happy to help improve the docs for strings.Builder. May I be assigned to this issue?

@bradfitz
Copy link
Contributor

@MateusAmin, just send a change if you have one. We rarely use the GitHub assignee feature.

@rsc
Copy link
Contributor

rsc commented Nov 29, 2017

@bradfitz maybe it would make sense instead to put a note in bytes.Buffer that if you want to construct a string, using strings.Builder might be more efficient?

@gopherbot
Copy link

Change https://golang.org/cl/80815 mentions this issue: bytes: mention strings.Builder in Buffer.String docs

@golang golang locked and limited conversation to collaborators Nov 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants