]> Cypherpunks repositories - gostls13.git/commitdiff
os: remove unused testingForceReadDirLstat
authorTobias Klauser <tklauser@distanz.ch>
Fri, 7 Mar 2025 13:41:29 +0000 (14:41 +0100)
committerGopher Robot <gobot@golang.org>
Fri, 7 Mar 2025 19:33:06 +0000 (11:33 -0800)
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>

src/os/dir.go
src/os/export_test.go
src/os/file_unix.go

index cc3fd602afe10ea098396152946b7be121c4ed08..fb71d88e3e30b9dce0846f42a7e2c567195af355 100644 (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,
index 03df0ffccd3cea3145d9bf817989a207ae635473..93b10898e0b4ba45e1ddfe50a563a4fd1e8b3e31 100644 (file)
@@ -9,7 +9,6 @@ package os
 var Atime = atime
 var LstatP = &lstat
 var ErrWriteAtInAppendMode = errWriteAtInAppendMode
-var TestingForceReadDirLstat = &testingForceReadDirLstat
 var ErrPatternHasSeparator = errPatternHasSeparator
 
 func init() {
index 6ddeae3bd345c0e4f0acc638421c29b05984f368..287e322304860df372ecb59cb99245104a9f1e19 100644 (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
        }