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

proposal: Go 2: bytes: remove NewBufferString #26281

Open
robpike opened this issue Jul 9, 2018 · 1 comment
Open

proposal: Go 2: bytes: remove NewBufferString #26281

robpike opened this issue Jul 9, 2018 · 1 comment
Labels
Go2Cleanup Used by Ian and Robert for Go 2 organization. Unless you’re Ian or Robert, please do not use this. Proposal v2 A language change or incompatible library change
Milestone

Comments

@robpike
Copy link
Contributor

robpike commented Jul 9, 2018

The constructor is often misused and confuses people. It can be used to put initial contents into a buffer that will be written into after, but so can buf.Write. Meanwhile, NewReader handles the case that most beginners misuse, calling NewBufferString when they only need NewBuffer.

This function's use case is not worth the confusion it causes and it should be deleted from the library.

@robpike robpike added the v2 A language change or incompatible library change label Jul 9, 2018
@ianlancetaylor ianlancetaylor added this to the Go2 milestone Jul 9, 2018
@ianlancetaylor ianlancetaylor changed the title bytes: remove NewBufferString proposal: Go 2: bytes: remove NewBufferString Oct 2, 2018
@ianlancetaylor ianlancetaylor added the Go2Cleanup Used by Ian and Robert for Go 2 organization. Unless you’re Ian or Robert, please do not use this. label Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Go2Cleanup Used by Ian and Robert for Go 2 organization. Unless you’re Ian or Robert, please do not use this. Proposal v2 A language change or incompatible library change
Projects
None yet
Development

No branches or pull requests

4 participants
@ianlancetaylor @robpike @gopherbot and others