diff --git a/fs/fs.go b/fs/fs.go index c881d78..596b8d7 100644 --- a/fs/fs.go +++ b/fs/fs.go @@ -7,7 +7,7 @@ import ( "github.com/markbates/pkger/here" ) -type FileSystem interface { +type Warehouse interface { Parse(p string) (Path, error) Abs(string) (string, error) AbsPath(Path) (string, error) diff --git a/fs/fstest/fstest.go b/fs/fstest/fstest.go index 1898958..581f6b1 100644 --- a/fs/fstest/fstest.go +++ b/fs/fstest/fstest.go @@ -4,7 +4,7 @@ import ( "github.com/markbates/pkger/fs" ) -func Files(fx fs.FileSystem) (TestFiles, error) { +func Files(fx fs.Warehouse) (TestFiles, error) { tf := TestFiles{} for _, f := range fileList { pt, err := fx.Parse(f) diff --git a/fs/fstest/suite.go b/fs/fstest/suite.go index fe04ab9..5d64d95 100644 --- a/fs/fstest/suite.go +++ b/fs/fstest/suite.go @@ -18,12 +18,12 @@ const hart = "/easy/listening/grant.hart" const husker = "github.com/husker/du" type Suite struct { - fs.FileSystem + fs.Warehouse } -func NewSuite(yourfs fs.FileSystem) (Suite, error) { +func NewSuite(yourfs fs.Warehouse) (Suite, error) { suite := Suite{ - FileSystem: yourfs, + Warehouse: yourfs, } return suite, nil } @@ -45,7 +45,7 @@ func (s Suite) Test(t *testing.T) { func (s Suite) sub(t *testing.T, m reflect.Method) { name := strings.TrimPrefix(m.Name, "Test_") - name = fmt.Sprintf("%T_%s", s.FileSystem, name) + name = fmt.Sprintf("%T_%s", s.Warehouse, name) t.Run(name, func(st *testing.T) { defer func() { if err := recover(); err != nil { diff --git a/fs/hdfs/file.go b/fs/hdfs/file.go index 82f455e..52219f2 100644 --- a/fs/hdfs/file.go +++ b/fs/hdfs/file.go @@ -15,10 +15,10 @@ type File struct { info *fs.FileInfo her here.Info path fs.Path - fs fs.FileSystem + fs fs.Warehouse } -func NewFile(fx fs.FileSystem, osf *os.File) (*File, error) { +func NewFile(fx fs.Warehouse, osf *os.File) (*File, error) { pt, err := fx.Parse(osf.Name()) if err != nil { diff --git a/fs/hdfs/hdfs.go b/fs/hdfs/hdfs.go index fc92489..e80e61f 100644 --- a/fs/hdfs/hdfs.go +++ b/fs/hdfs/hdfs.go @@ -12,7 +12,7 @@ import ( "github.com/markbates/pkger/internal/maps" ) -var _ fs.FileSystem = &FS{} +var _ fs.Warehouse = &FS{} type FS struct { infos *maps.Infos diff --git a/fs/memfs/file.go b/fs/memfs/file.go index 0ff8834..c6192ff 100644 --- a/fs/memfs/file.go +++ b/fs/memfs/file.go @@ -27,7 +27,7 @@ type File struct { parent fs.Path writer *bytes.Buffer reader io.Reader - fs fs.FileSystem + fs fs.Warehouse } func (f *File) Seek(offset int64, whence int) (int64, error) { diff --git a/fs/memfs/memfs.go b/fs/memfs/memfs.go index 7abb9a5..537cf82 100644 --- a/fs/memfs/memfs.go +++ b/fs/memfs/memfs.go @@ -11,7 +11,7 @@ import ( "github.com/markbates/pkger/internal/maps" ) -var _ fs.FileSystem = &FS{} +var _ fs.Warehouse = &FS{} func WithInfo(fx *FS, infos ...here.Info) { for _, info := range infos {