forked from mirror/pkger
19 lines
271 B
Go
19 lines
271 B
Go
|
package memfs
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
func (fx *FS) Stat(name string) (os.FileInfo, error) {
|
||
|
pt, err := fx.Parse(name)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
f, ok := fx.files.Load(pt)
|
||
|
if ok {
|
||
|
return f.Stat()
|
||
|
}
|
||
|
return nil, fmt.Errorf("could not stat %s", name)
|
||
|
}
|