diff options
| author | Damien Neil <dneil@google.com> | 2021-07-07 09:32:17 -0700 |
|---|---|---|
| committer | Damien Neil <dneil@google.com> | 2022-05-17 01:50:34 +0000 |
| commit | aedf298daf508b564e4dddc7687fff8822315a5e (patch) | |
| tree | 485ac77706ac3634ec65a3124ac6942a043c9c58 /src | |
| parent | f2b1cde544d190e1f4642ef6f4ac8ef9ce31a0c3 (diff) | |
| download | go-aedf298daf508b564e4dddc7687fff8822315a5e.tar.xz | |
io/fs: document requirement that ReadDir return an unwrapped io.EOF
This requirement ensures that ReadDir implementations are as compatible
as possible with "*os.File".ReadDir.
The testing/fstest package already tests for equality to io.EOF.
Updates #47062.
Fixes #47086.
Change-Id: I54f911a34e507a3db0abc4da55a19b7a50b35041
Reviewed-on: https://go-review.googlesource.com/c/go/+/333149
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/io/fs/fs.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/io/fs/fs.go b/src/io/fs/fs.go index 5c0d9a6664..4ce4d1a528 100644 --- a/src/io/fs/fs.go +++ b/src/io/fs/fs.go @@ -120,6 +120,7 @@ type ReadDirFile interface { // In this case, if ReadDir returns an empty slice, it will return // a non-nil error explaining why. // At the end of a directory, the error is 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 // in a single slice. In this case, if ReadDir succeeds (reads all the way |
