pkg/environment: Migrate fs functions to fsx
This commit is contained in:
parent
45540ab253
commit
5a43ecfaeb
21 changed files with 155 additions and 199 deletions
|
|
@ -1,25 +1,3 @@
|
|||
package environment
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/fs"
|
||||
)
|
||||
|
||||
// Environment represents an environment that a program can run it.
|
||||
// It mostly mimics the interfaces of the [os] package.
|
||||
type Environment interface {
|
||||
isEnv()
|
||||
|
||||
Create(path string, mode fs.FileMode) (WritableFile, error)
|
||||
Mkdir(path string, mode fs.FileMode) error
|
||||
MkdirAll(path string, mode fs.FileMode) error
|
||||
}
|
||||
|
||||
type WritableFile interface {
|
||||
fs.File
|
||||
io.Writer
|
||||
}
|
||||
|
||||
func init() {
|
||||
var _ Environment = new(Native)
|
||||
}
|
||||
type Environment struct{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue