File tree 1 file changed +2
-12
lines changed
1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 4
4
"io/fs"
5
5
"path"
6
6
"strings"
7
-
8
- "golang.org/x/xerrors"
9
7
)
10
8
11
9
// overlayFS allows you to "join" together multiple fs.FS. Files in any specific
@@ -48,11 +46,7 @@ func (f overlayFS) ReadDir(p string) ([]fs.DirEntry, error) {
48
46
break
49
47
}
50
48
}
51
- it , ok := target .(fs.ReadDirFS )
52
- if ! ok {
53
- return nil , xerrors .New ("provided fs.FS does not implement fs.ReadDirFS" )
54
- }
55
- return it .ReadDir (p )
49
+ return fs .ReadDir (target , p )
56
50
}
57
51
58
52
func (f overlayFS ) ReadFile (p string ) ([]byte , error ) {
@@ -63,9 +57,5 @@ func (f overlayFS) ReadFile(p string) ([]byte, error) {
63
57
break
64
58
}
65
59
}
66
- it , ok := target .(fs.ReadFileFS )
67
- if ! ok {
68
- return nil , xerrors .New ("provided fs.FS does not implement fs.ReadFileFS" )
69
- }
70
- return it .ReadFile (p )
60
+ return fs .ReadFile (target , p )
71
61
}
You can’t perform that action at this time.
0 commit comments