From: Tobias Klauser Date: Fri, 7 Mar 2025 13:41:29 +0000 (+0100) Subject: os: remove unused testingForceReadDirLstat X-Git-Tag: go1.25rc1~793 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e6908846df5f521ba0c927c3ce4a06ed11a6d04c;p=gostls13.git 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 Reviewed-by: Ian Lance Taylor Reviewed-by: Junyang Shao Auto-Submit: Tobias Klauser --- diff --git a/src/os/dir.go b/src/os/dir.go index cc3fd602af..fb71d88e3e 100644 --- a/src/os/dir.go +++ b/src/os/dir.go @@ -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, diff --git a/src/os/export_test.go b/src/os/export_test.go index 03df0ffccd..93b10898e0 100644 --- a/src/os/export_test.go +++ b/src/os/export_test.go @@ -9,7 +9,6 @@ package os var Atime = atime var LstatP = &lstat var ErrWriteAtInAppendMode = errWriteAtInAppendMode -var TestingForceReadDirLstat = &testingForceReadDirLstat var ErrPatternHasSeparator = errPatternHasSeparator func init() { diff --git a/src/os/file_unix.go b/src/os/file_unix.go index 6ddeae3bd3..287e322304 100644 --- a/src/os/file_unix.go +++ b/src/os/file_unix.go @@ -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 }