Skip to content

proposal: bufio: add option to Scanner to skip tokens that are too long #26466

@jackxbritton

Description

@jackxbritton

I want to scan a reader and skip any tokens that will fire bufio.ErrTooLong. Here's an example of what I have to do with the existing implementation of scanner: https://play.golang.org/p/LimudFrPRC4.

I'd like to have the option for scanner to skip tokens that are too long. I think adding a variable to scanner like skipTooLongTokens bool, set via a call to scanner.SetFlags(bufio.LSkipTooLongTokens) or something like that, would be very helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeProposalWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions