Skip to content

bufio: Reader.Peek should return partial result on ErrBufferFull #14121

@niemeyer

Description

@niemeyer

The documentation of Reader.Peek gives the impression that it'll return the available data on errors, and in most cases it does. But when returning ErrBufferFull, which is a clear indication that there is data to return, it may actually return data or not depending on which path returns the error. It should consistently return the available data instead.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions