diff --git a/os/fs.go b/os/fs.go index 16c4e98..133bd21 100644 --- a/os/fs.go +++ b/os/fs.go @@ -32,7 +32,7 @@ func NewFS() *FS { // SubVolume is like Sub, but only sets the volume name (i.e. for Windows). // Calling SubVolume again on the returned FS results in an error. -func (fs *FS) SubVolume(volumeName string) (hackpadfs.FS, error) { +func (fs *FS) SubVolume(volumeName string) (*FS, error) { if fs.root != "" { return nil, &hackpadfs.PathError{Op: "subvolume", Path: volumeName, Err: errors.New("subvolume not supported on a SubFS")} } @@ -48,7 +48,7 @@ func (fs *FS) SubVolume(volumeName string) (hackpadfs.FS, error) { } // Sub implements hackpadfs.SubFS -func (fs *FS) Sub(dir string) (hackpadfs.FS, error) { +func (fs *FS) Sub(dir string) (*FS, error) { if !hackpadfs.ValidPath(dir) { return nil, &hackpadfs.PathError{Op: "sub", Path: dir, Err: hackpadfs.ErrInvalid} } diff --git a/os/fs_test.go b/os/fs_test.go index 4446b2e..266f115 100644 --- a/os/fs_test.go +++ b/os/fs_test.go @@ -31,7 +31,7 @@ func TestFSTest(t *testing.T) { if !assert.NoError(tb, err) { tb.FailNow() } - fs = subvFS.(*FS) + fs = subvFS dir = dir[len(volumeName)+1:] } else { dir = strings.TrimPrefix(dir, "/") @@ -40,7 +40,7 @@ func TestFSTest(t *testing.T) { if !assert.NoError(tb, err) { tb.FailNow() } - return subFS.(*FS) + return subFS }, } var skipFacets []fstest.Facets