Skip to content

bufio: SplitFunc documentation does not document ErrFinalToken #44261

@JensRantil

Description

@JensRantil

What did you do?

I went to https://golang.org/pkg/bufio/#SplitFunc and read the documentation to implement a SplitFunc. In my implementation of a SplitFunc, for the case of atEOF, I simply returned len(data), data, nil thinking the Scanner would stop calling my function. It didn't (I was getting panic: bufio.Scan: too many empty tokens without progressing). I went back and looked at the "EmptyFinalToken" example here. It refered to ErrFinalToken which I was surprised to see since it wasn't mentioned in the SplitFunc documentation.

What did you expect to see?

I'd expect the SplitFunc documentation to include a reference to ErrFinalToken.

What did you see instead?

No reference to it at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.help wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions