And setup and teardown

Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
This commit is contained in:
Xianglin Gao
2017-05-22 13:28:05 +08:00
parent 87c704bdf5
commit 6d2b9fabca
5 changed files with 48 additions and 11 deletions

View File

@@ -31,6 +31,7 @@ type OS interface {
MkdirAll(path string, perm os.FileMode) error
RemoveAll(path string) error
OpenFifo(ctx context.Context, fn string, flag int, perm os.FileMode) (io.ReadWriteCloser, error)
Stat(name string) (os.FileInfo, error)
}
// RealOS is used to dispatch the real system level operations.
@@ -50,3 +51,8 @@ func (RealOS) RemoveAll(path string) error {
func (RealOS) OpenFifo(ctx context.Context, fn string, flag int, perm os.FileMode) (io.ReadWriteCloser, error) {
return fifo.OpenFifo(ctx, fn, flag, perm)
}
// Stat will call os.Stat to get the status of the given file.
func (RealOS) Stat(name string) (os.FileInfo, error) {
return os.Stat(name)
}