diff --git a/README.md b/README.md index 256dffe..4caed92 100644 --- a/README.md +++ b/README.md @@ -100,8 +100,10 @@ the ability to drop in other filesystems as desired. Then throughout your functions and methods use the methods familiar already from the OS package. -Methods Available: +File System Methods Available: + Chmod(name string, mode os.FileMode) : error + Chtimes(name string, atime time.Time, mtime time.Time) : error Create(name string) : File, error Mkdir(name string, perm os.FileMode) : error MkdirAll(path string, perm os.FileMode) : error @@ -113,6 +115,22 @@ Methods Available: Rename(oldname, newname string) : error Stat(name string) : os.FileInfo, error +File Interfaces and Methods Available: + + io.Closer + io.Reader + io.ReaderAt + io.Seeker + io.Writer + io.WriterAt + + Stat() : os.FileInfo, error + Readdir(count int) : []os.FileInfo, error + Readdirnames(n int) : []string, error + WriteString(s string) : ret int, err error + Truncate(size int64) : error + Name() : string + In our case we would call `AppFs.Open()` as an example because that is how we’ve defined to access our filesystem. diff --git a/fs_test.go b/fs_test.go index 99ab330..92cbf6f 100644 --- a/fs_test.go +++ b/fs_test.go @@ -362,6 +362,7 @@ func TestReaddirSimple(t *testing.T) { func TestReaddir(t *testing.T) { for num := 0; num < 6; num++ { outputs := make([]string, len(Fss)) + infos := make([]string, len(Fss)) for i, fs := range Fss { root, err := fs.Open(testSubDir) if err != nil { @@ -370,15 +371,16 @@ func TestReaddir(t *testing.T) { for j := 0; j < 6; j++ { info, err := root.Readdir(num) outputs[i] += fmt.Sprintf("%v Error: %v\n", myFileInfo(info), err) + infos[i] += fmt.Sprintln(len(info), err) } } fail := false - for i, o := range outputs { + for i, o := range infos { if i == 0 { continue } - if o != outputs[i-1] { + if o != infos[i-1] { fail = true break }