File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,17 @@ type File interface {
173
173
Lock () error
174
174
// Unlock unlocks the file.
175
175
Unlock () error
176
+ // Readdir reads the contents of the directory associated with file and returns a
177
+ // slice of up to n FileInfo values, as would be returned by Lstat, in directory order.
178
+ // Subsequent calls on the same file will yield further FileInfos.
179
+ // If n > 0, Readdir returns at most n FileInfo structures. In this case, if Readdir
180
+ // returns an empty slice, it will return a non-nil error explaining why. At the end of
181
+ // a directory, the error is io.EOF.
182
+ // If n <= 0, Readdir returns all the FileInfo from the directory in a single slice.
183
+ // In this case, if Readdir succeeds (reads all the way to the end of the directory),
184
+ // it returns the slice and a nil error. If it encounters an error before the end of the directory,
185
+ // Readdir returns the FileInfo read until that point and a non-nil error.
186
+ Readdir (count int ) ([]os.FileInfo , error )
176
187
// Truncate the file.
177
188
Truncate (size int64 ) error
178
189
}
Original file line number Diff line number Diff line change @@ -135,6 +135,10 @@ func (*FileMock) Truncate(size int64) error {
135
135
return nil
136
136
}
137
137
138
+ func (* FileMock ) Readdir (count int ) ([]os.FileInfo , error ) {
139
+ return nil , nil
140
+ }
141
+
138
142
type OnlyReadCapFs struct {
139
143
BasicMock
140
144
}
You can’t perform that action at this time.
0 commit comments