Skip to content

bufio: Scanner should error out if empty token at EOF keeps happening #9020

@robpike

Description

@robpike
from rsc:

The most common failure mode for a bad split function is an infinite loop
generating empty tokens at EOF. Programs that used to 'work' now hang. I saw
this a couple times updating Google code. Should we make the Scanner
implementation count empty tokens at EOF and panic if it sees 100 or something
like that?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions