os: remove unused testingForceReadDirLstat

It was introduced in CL 261540 but never set by any test.

Change-Id: Id2a59c58ed510b6041cc51ce47ab79199a60b215
Reviewed-on: https://go-review.googlesource.com/c/go/+/655797
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
Tobias Klauser 2025-03-07 14:41:29 +01:00 committed by Gopher Robot
parent 705fa920c1
commit e6908846df
3 changed files with 1 additions and 6 deletions

View File

@ -106,10 +106,6 @@ func (f *File) ReadDir(n int) ([]DirEntry, error) {
return dirents, err
}
// testingForceReadDirLstat forces ReadDir to call Lstat, for testing that code path.
// This can be difficult to provoke on some Unix systems otherwise.
var testingForceReadDirLstat bool
// ReadDir reads the named directory,
// returning all its directory entries sorted by filename.
// If an error occurs reading the directory,

View File

@ -9,7 +9,6 @@ package os
var Atime = atime
var LstatP = &lstat
var ErrWriteAtInAppendMode = errWriteAtInAppendMode
var TestingForceReadDirLstat = &testingForceReadDirLstat
var ErrPatternHasSeparator = errPatternHasSeparator
func init() {

View File

@ -482,7 +482,7 @@ func newUnixDirent(parent, name string, typ FileMode) (DirEntry, error) {
name: name,
typ: typ,
}
if typ != ^FileMode(0) && !testingForceReadDirLstat {
if typ != ^FileMode(0) {
return ude, nil
}