@@ -15,6 +15,7 @@ type FS struct {
15
15
}
16
16
17
17
// Create returns a file system that prefixes all paths and forwards to root.
18
+ // Note: This is equivalent to the os.DirFS(prefix) call.
18
19
func Create (root vfs.Filesystem , prefix string ) * FS {
19
20
return & FS {Filesystem : root , Prefix : prefix }
20
21
}
@@ -37,6 +38,10 @@ func (fs *FS) Remove(name string) error {
37
38
return fs .Filesystem .Remove (fs .PrefixPath (name ))
38
39
}
39
40
41
+ func (fs * FS ) RemoveAll (path string ) error {
42
+ return fs .Filesystem .RemoveAll (fs .PrefixPath (path ))
43
+ }
44
+
40
45
// Rename implements vfs.Filesystem.
41
46
func (fs * FS ) Rename (oldpath , newpath string ) error {
42
47
return fs .Filesystem .Rename (fs .PrefixPath (oldpath ), fs .PrefixPath (newpath ))
@@ -47,6 +52,10 @@ func (fs *FS) Mkdir(name string, perm os.FileMode) error {
47
52
return fs .Filesystem .Mkdir (fs .PrefixPath (name ), perm )
48
53
}
49
54
55
+ func (fs * FS ) MkdirAll (path string , perm os.FileMode ) error {
56
+ return fs .Filesystem .MkdirAll (fs .PrefixPath (path ), perm )
57
+ }
58
+
50
59
// Symlink implements vfs.Filesystem.
51
60
func (fs * FS ) Symlink (oldname , newname string ) error {
52
61
return fs .Filesystem .Symlink (fs .PrefixPath (oldname ), fs .PrefixPath (newname ))
0 commit comments