Skip to content

io/fs: document ReadDirFile io.EOF implementation requirements more precisely #47086

@mknyszek

Description

@mknyszek

Splintering out from a discussion in #47062, it's probably worth pointing out that like an io.Reader, an fs.ReadDirFile's ReadDir should return only an io.EOF, and not anything wrapping it. Code in testing/fstest already depends on this behavior and assumes it for a correct implementation.

Alternatively, because this API is relatively new, it might still be possible to relax it to allow for wrapping. However, since it's already been almost one full release and io.EOF is already used a sentinel in other APIs, it doesn't seem worth it to break the pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions