File tree Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package billy
3
3
import (
4
4
"errors"
5
5
"io"
6
+ "io/fs"
6
7
"os"
7
8
"time"
8
9
)
@@ -161,15 +162,15 @@ type Chroot interface {
161
162
162
163
// File represent a file, being a subset of the os.File
163
164
type File interface {
165
+ fs.File
166
+
164
167
// Name returns the name of the file as presented to Open.
165
168
Name () string
166
169
io.Writer
167
- // TODO: Add io.WriterAt for v6
170
+ // TODO: Add io.WriterAt for v6
168
171
// io.WriterAt
169
- io.Reader
170
172
io.ReaderAt
171
173
io.Seeker
172
- io.Closer
173
174
// Lock locks the file like e.g. flock. It protects against access from
174
175
// other processes.
175
176
Lock () error
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package test
2
2
3
3
import (
4
4
"bytes"
5
+ "io/fs"
5
6
"os"
6
7
"path"
7
8
"path/filepath"
@@ -135,6 +136,10 @@ func (*FileMock) Unlock() error {
135
136
return nil
136
137
}
137
138
139
+ func (* FileMock ) Stat () (fs.FileInfo , error ) {
140
+ return nil , nil
141
+ }
142
+
138
143
func (* FileMock ) Truncate (size int64 ) error {
139
144
return nil
140
145
}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package memfs
3
3
import (
4
4
"fmt"
5
5
"io"
6
+ "io/fs"
6
7
"os"
7
8
"runtime"
8
9
"testing"
@@ -14,6 +15,8 @@ import (
14
15
"github.com/stretchr/testify/require"
15
16
)
16
17
18
+ var _ fs.File = & file {}
19
+
17
20
func TestRootExists (t * testing.T ) {
18
21
fs := New ()
19
22
f , err := fs .Stat ("/" )
Original file line number Diff line number Diff line change 4
4
package osfs
5
5
6
6
import (
7
+ "io/fs"
7
8
"reflect"
8
9
"testing"
9
10
)
10
11
12
+ var _ fs.File = & file {}
13
+
11
14
func TestDefault (t * testing.T ) {
12
15
want := & ChrootOS {}
13
16
got := Default
You can’t perform that action at this time.
0 commit comments