Skip to content
Snippets Groups Projects
Commit ad043420 authored by Matthew Burton's avatar Matthew Burton Committed by Gopher Robot
Browse files

fs: clarify documentation for ReadDir method

The fs.ReadDir method behaves the same way as
os.ReadDir, in that when n <= 0, ReadDir returns
all DirEntry values remaining in the dictionary.

Update the comment to reflect that only remaining
DirEntry values are returned (not all entries),
for subsequent calls.

Fixes #69301

Change-Id: I41ef7ef1c8e3fe7d64586f5297512697dc60dd40
Reviewed-on: https://go-review.googlesource.com/c/go/+/663215


Reviewed-by: default avatarKeith Randall <khr@google.com>
Reviewed-by: default avatarSean Liao <sean@liao.dev>
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: default avatarJorropo <jorropo.pgm@gmail.com>
Reviewed-by: default avatarDavid Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
parent a4d0269a
No related branches found
No related tags found
No related merge requests found
...@@ -129,7 +129,7 @@ type ReadDirFile interface { ...@@ -129,7 +129,7 @@ type ReadDirFile interface {
// At the end of a directory, the error is io.EOF. // At the end of a directory, the error is io.EOF.
// (ReadDir must return io.EOF itself, not an error wrapping io.EOF.) // (ReadDir must return io.EOF itself, not an error wrapping io.EOF.)
// //
// If n <= 0, ReadDir returns all the DirEntry values from the directory // If n <= 0, ReadDir returns all remaining DirEntry values from the directory
// in a single slice. In this case, if ReadDir succeeds (reads all the way // in a single slice. In this case, if ReadDir succeeds (reads all the way
// to the end of the directory), it returns the slice and a nil error. // to the end of the directory), it returns the slice and a nil error.
// If it encounters an error before the end of the directory, // If it encounters an error before the end of the directory,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment