Source File
filesystem.go
Belonging Package
github.com/kr/fs
package fsimport ()// FileSystem defines the methods of an abstract filesystem.type FileSystem interface {// ReadDir reads the directory named by dirname and returns a// list of directory entries.ReadDir(dirname string) ([]os.FileInfo, error)// Lstat returns a FileInfo describing the named file. If the file is a// symbolic link, the returned FileInfo describes the symbolic link. Lstat// makes no attempt to follow the link.Lstat(name string) (os.FileInfo, error)// Join joins any number of path elements into a single path, adding a// separator if necessary. The result is Cleaned; in particular, all// empty strings are ignored.//// The separator is FileSystem specific.Join(elem ...string) string}// fs represents a FileSystem provided by the os package.type fs struct{}func ( *fs) ( string) ([]os.FileInfo, error) { return ioutil.ReadDir() }func ( *fs) ( string) (os.FileInfo, error) { return os.Lstat() }func ( *fs) ( ...string) string { return filepath.Join(...) }
![]() |
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |