You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, readSlice method in bytes.Buffer is private, which means there is no easy way to read the buffer by delimiter without needlessly allocating another slice.
Since it is already there, and bufio package has the same method exported, I propose making this method exported in the bytes package as well (with proper warnings about its usage in the comments, the same way bufio does it).
I can submit a patch, but since I'm not sure whether these kind of changes are acceptable (it is non-breaking change, right?), I'd rather ask first.
The text was updated successfully, but these errors were encountered:
Yes, you can, or just implement readSlice yourself in like 5 lines. It is just a matter of convenience and bufio already has it (in fact, it took me a while to figure out why do I remember that I could use ReadSlice - I've used it on bufio.Reader previously), so I thought I'd mention it and/or send a patch.
Sorry, I don't think we'll do this. We try not to expand the API unless it's really valuable (needed by many people and/or solves a problem not otherwise solvable). I don't think this falls into either of those buckets.
Currently,
readSlice
method inbytes.Buffer
is private, which means there is no easy way to read the buffer by delimiter without needlessly allocating another slice.Since it is already there, and bufio package has the same method exported, I propose making this method exported in the
bytes
package as well (with proper warnings about its usage in the comments, the same waybufio
does it).I can submit a patch, but since I'm not sure whether these kind of changes are acceptable (it is non-breaking change, right?), I'd rather ask first.
The text was updated successfully, but these errors were encountered: