-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolProposalProposal-Accepted
Milestone
Description
Proposal Details
Add a Peek method to bytes.Buffer to avoid unnecessary wrapping when passing a buffer to image.Decode.
package bytes
// Peek returns the next n bytes without advancing the buffer.
// If there are fewer than n bytes in the buffer, it returns error [io.EOF].
// The slice is only valid until the next buffer modification.
func (b *Buffer) Peek(n int) ([]byte, error)See:
dolmen, silkeh, jfesler, q0w, peczenyj and 8 more
Metadata
Metadata
Assignees
Labels
LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolProposalProposal-Accepted
Type
Projects
Status
Accepted