fsutil

package
v0.5.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MkdirAll

func MkdirAll(path string, perm os.FileMode) error

MkdirAll calls FS.MakedirAll

func Open

func Open(name string) (fs.File, error)

Open calls FS.Open

Types

type DefaultFS

type DefaultFS struct{}

DefaultFS is the default OS implementation of FileSystem.

func (DefaultFS) MkdirAll

func (DefaultFS) MkdirAll(path string, perm fs.FileMode) error

MkdirAll implements FS

func (DefaultFS) Open

func (DefaultFS) Open(name string) (fs.File, error)

Open implements FS

type FileSystem

type FileSystem interface {
	MkdirAll(path string, perm os.FileMode) error
	fs.FS
}

FS is abstraction for filesystem.

var FS FileSystem = DefaultFS{}

FS is the host filesystem implementation.

var FakeFS FileSystem = fakeFS{}

FakeFS is a mock FS. The following can be done in a test before usage.

osutil.FS = osutil.FakeFS

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL