Skip to content

strings: documentation refers to non-existent function SplitFunc #75462

Closed

Description

@tobyb121

Go version

go version 1.25.1

Output of go env in your module/workspace:

N/A

What did you do?

I noticed in the function documentation for strings.FieldsFunc it refers to SplitFunc when describing the behaviour of the function. https://pkg.go.dev/strings#FieldsFunc

What did you see happen?

This function does not exist in this package, there is a type https://pkg.go.dev/bufio#SplitFunc, however I do not think this makes sense in the context.

This seems to be an oversight as it is mirroring the documentation of the Fields function, which correctly refers to the behaviour of Split.

What did you expect to see?

For symmetry with the Fields* functions in the strings package, I'd expect to see a SplitFunc, SplitFuncSeq, SplitNFunc, SplitNFuncSeq, SplitAfterFunc, SplitAfterFuncSeq, SplitAfterNFunc, SplitAfterNFuncSeq

Activity

  1. tobyb121 commented on Sep 14, 2025

    @tobyb121
    Author

    Thinking a bit more about this, Func variants of Split would behave differently from Split, as they apply per-rune rather than on a separator string, so it probably makes sense to just fix the documentation here.

  2. seankhliao commented on Sep 14, 2025

    @seankhliao
    Member

    ah yes it should refer to just split

  3. added
    FixPendingIssues that have a fix which has not yet been reviewed or submitted.
    on Sep 14, 2025
  4. gopherbot commented on Sep 14, 2025

    @gopherbot
    Contributor

    Change https://go.dev/cl/703675 mentions this issue: bytes,strings: remove reference to non-existent SplitFunc

  5. TapirLiu commented on Sep 14, 2025

    @TapirLiu
    Contributor

    The doc build process should detect such broken links automatically.

  6. added a commit that references this issue on Sep 16, 2025
    ac82fe6
  7. locked and limited conversation to collaborators on Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FixPendingIssues that have a fix which has not yet been reviewed or submitted.FrozenDueToAge

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions