File tree 2 files changed +2
-139
lines changed
2 files changed +2
-139
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,9 @@ package vfs
7
7
import (
8
8
"fmt"
9
9
"io/ioutil"
10
- "log"
11
10
"os"
12
11
pathpkg "path"
13
12
"path/filepath"
14
- "strings"
15
13
)
16
14
17
15
// OS returns an implementation of FileSystem reading from the
@@ -59,35 +57,9 @@ func (root osFS) Lstat(path string) (os.FileInfo, error) {
59
57
}
60
58
61
59
func (root osFS ) Stat (path string ) (os.FileInfo , error ) {
62
- return stat (root .resolve (path ))
60
+ return os . Stat (root .resolve (path ))
63
61
}
64
62
65
- var readdir = ioutil .ReadDir // for testing
66
- var stat = os .Stat // for testing
67
-
68
63
func (root osFS ) ReadDir (path string ) ([]os.FileInfo , error ) {
69
- fis , err := readdir (root .resolve (path ))
70
- if err != nil {
71
- return fis , err
72
- }
73
- ret := fis [:0 ]
74
-
75
- // reread the files with os.Stat since they might be symbolic links
76
- for _ , fi := range fis {
77
- if fi .Mode ()& os .ModeSymlink != 0 {
78
- baseName := fi .Name ()
79
- fi , err = root .Stat (pathpkg .Join (path , baseName ))
80
- if err != nil {
81
- if os .IsNotExist (err ) && strings .HasPrefix (baseName , "." ) {
82
- // Ignore editor spam files without log spam.
83
- continue
84
- }
85
- log .Printf ("ignoring symlink: %v" , err )
86
- continue
87
- }
88
- }
89
- ret = append (ret , fi )
90
- }
91
-
92
- return ret , nil // is sorted
64
+ return ioutil .ReadDir (root .resolve (path )) // is sorted
93
65
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments