Initial commit
This commit is contained in:
18
internal/filesystem/set.go
Normal file
18
internal/filesystem/set.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package filesystem
|
||||
|
||||
import "github.com/spf13/afero"
|
||||
|
||||
// SetOsFs sets the filesystem to the os filesystem
|
||||
func SetOsFs() {
|
||||
if wrapper.Fs == nil || wrapper.Fs.Name() != "os" {
|
||||
wrapper.Fs = afero.NewOsFs()
|
||||
}
|
||||
}
|
||||
|
||||
// SetMemMapFs sets the filesystem to the memory mapped filesystem
|
||||
// Use this if you want to use the filesystem in a sandbox
|
||||
func SetMemMapFs() {
|
||||
if wrapper.Fs == nil || wrapper.Fs.Name() != "memmap" {
|
||||
wrapper.Fs = afero.NewMemMapFs()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user