io/fs: document ReadDirFile io.EOF implementation requirements more precisely #47086
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Splintering out from a discussion in #47062, it's probably worth pointing out that like an
io.Reader
, anfs.ReadDirFile
'sReadDir
should return only anio.EOF
, and not anything wrapping it. Code intesting/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.The text was updated successfully, but these errors were encountered: