Skip to content

proposal: bytes/v2: remove NewBufferStringย #26281

Open
@robpike

Description

@robpike

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Proposalv2An incompatible library change

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions