mirror of https://github.com/spf13/afero.git
Add Sync() to the File interface, implement Sync() for InMemoryFile
Sync() for InMemoryFile always returns nil.
This commit is contained in:
parent
aca753daff
commit
33ecf3dc6b
9
fs.go
9
fs.go
|
@ -39,13 +39,14 @@ type File interface {
|
|||
io.Seeker
|
||||
io.Writer
|
||||
io.WriterAt
|
||||
//Fd() uintptr
|
||||
Stat() (os.FileInfo, error)
|
||||
|
||||
Name() string
|
||||
Readdir(count int) ([]os.FileInfo, error)
|
||||
Readdirnames(n int) ([]string, error)
|
||||
WriteString(s string) (ret int, err error)
|
||||
Stat() (os.FileInfo, error)
|
||||
Sync() error
|
||||
Truncate(size int64) error
|
||||
Name() string
|
||||
WriteString(s string) (ret int, err error)
|
||||
}
|
||||
|
||||
// Fs is the filesystem interface.
|
||||
|
|
|
@ -74,6 +74,10 @@ func (f *InMemoryFile) Stat() (os.FileInfo, error) {
|
|||
return &InMemoryFileInfo{f}, nil
|
||||
}
|
||||
|
||||
func (f *InMemoryFile) Sync() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *InMemoryFile) Readdir(count int) (res []os.FileInfo, err error) {
|
||||
var outLength int64
|
||||
|
||||
|
|
Loading…
Reference in New Issue