diff --git a/src/net/http/example_filesystem_test.go b/src/net/http/example_filesystem_test.go index 0e81458a071..ebcb994f436 100644 --- a/src/net/http/example_filesystem_test.go +++ b/src/net/http/example_filesystem_test.go @@ -5,6 +5,7 @@ package http_test import ( + "io" "io/fs" "log" "net/http" @@ -40,6 +41,9 @@ func (f dotFileHidingFile) Readdir(n int) (fis []fs.FileInfo, err error) { fis = append(fis, file) } } + if err == nil && n > 0 && len(fis) == 0 { + err = io.EOF + } return }