Remove unuused internal function

This commit is contained in:
Tom Wiesing 2022-09-11 17:26:01 +02:00
parent abafab9f0a
commit 04b74e0491
No known key found for this signature in database

View file

@ -1,31 +0,0 @@
package fsx
import "io/fs"
// OpenFS opens the named file in filesystem.
// If opening the file results in an error, returns [ErrFile].
func OpenFS(name string, fsys fs.FS) fs.File {
file, err := fsys.Open(name)
if err != nil {
return ErrFile{Err: err}
}
return file
}
// ErrFile implements a no-op [fs.File].
//
// Every operation will return an underlying error
type ErrFile struct {
Err error
}
func (err ErrFile) Stat() (fs.FileInfo, error) {
return nil, err.Err
}
func (err ErrFile) Read([]byte) (int, error) {
return 0, err.Err
}
func (err ErrFile) Close() error {
return err.Err
}