Skip to content

strings, bytes: divergent documentation for FieldsFunc functions #38630

@kprav33n

Description

@kprav33n

What version of Go are you using (go version)?

$ go version
go version go1.14.2 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

Read the documentation for strings.FieldsFunc

What did you see?

I see that the documentation is out of date with respect to the following note.

FieldsFunc makes no guarantees about the order in which it calls f(c). If f does
not return consistent results for a given c, FieldsFunc may crash.

This was appropriate when FieldsForFunc was using a two-pass logic. However, when the function was optimized to address #19789, this note is not correct anymore. The new implementation does only one-pass over the input. Hence, we can safely remove this note.

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.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions