fsx: Remove environment references

This commit removes the reference to the environment from the fsx
package.
This commit is contained in:
Tom Wiesing 2023-03-02 11:47:11 +01:00
parent 5a43ecfaeb
commit 3263920d6b
No known key found for this signature in database
25 changed files with 167 additions and 183 deletions

25
pkg/fsx/dir.go Normal file
View file

@ -0,0 +1,25 @@
package fsx
import (
"io/fs"
"os"
)
// DefaultDirPerm should be used by callers to use a consistent mode for new directories.
const DefaultDirPerm fs.FileMode = fs.ModeDir | fs.ModePerm
// Mkdir is like [os.Mkdir].
func Mkdir(path string, mode fs.FileMode) error {
m.Lock()
defer m.Unlock()
return os.Mkdir(path, fs.ModeDir|mode)
}
// MkdirAll is like [os.MkdirAll].
func MkdirAll(path string, mode fs.FileMode) error {
m.Lock()
defer m.Unlock()
return os.MkdirAll(path, fs.ModeDir|mode)
}