Open
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:
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Incoming