mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Revert "testing/fstest: test that ReadDirFile on a non-dir fails"
This reverts commit 1853411d83.
Reason for revert: broke plan 9 builder. fixes #44967
Change-Id: Ib89448d37f7ab8bb05dbd89ce744431d807eb4da
Reviewed-on: https://go-review.googlesource.com/c/go/+/301190
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
e8b82789cd
commit
9289c12002
1 changed files with 0 additions and 9 deletions
|
|
@ -119,9 +119,6 @@ func (t *fsTester) openDir(dir string) fs.ReadDirFile {
|
||||||
t.errorf("%s: Open: %v", dir, err)
|
t.errorf("%s: Open: %v", dir, err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// It'd be nice to test here that f.Read fails, because f is a directory.
|
|
||||||
// However, FreeBSD supports calling read on a directory.
|
|
||||||
// See https://groups.google.com/g/golang-dev/c/rh8jwxyG1PQ.
|
|
||||||
d, ok := f.(fs.ReadDirFile)
|
d, ok := f.(fs.ReadDirFile)
|
||||||
if !ok {
|
if !ok {
|
||||||
f.Close()
|
f.Close()
|
||||||
|
|
@ -517,12 +514,6 @@ func (t *fsTester) checkFile(file string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if dir, ok := f.(fs.ReadDirFile); ok {
|
|
||||||
if _, err := dir.ReadDir(-1); err == nil {
|
|
||||||
t.errorf("%s: ReadDir of non-dir file should return an error", file)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
data, err := ioutil.ReadAll(f)
|
data, err := ioutil.ReadAll(f)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
f.Close()
|
f.Close()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue