We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e20378 commit 7bf8f82Copy full SHA for 7bf8f82
file/file.go
@@ -11,17 +11,11 @@ type FileInfo struct {
11
Fileid uint64
12
}
13
14
-// FileInfoGetter allows os.FileInfo implementations that implement
15
-// the GetFileInfo() method to explicitly return a *FileInfo.
16
-// Useful for explicitly setting a Fileid without having to use the syscall package
17
-type FileInfoGetter interface {
18
- GetFileInfo() *FileInfo
19
-}
20
-
21
// GetInfo extracts some non-standardized items from the result of a Stat call.
22
func GetInfo(fi os.FileInfo) *FileInfo {
23
- if v, ok := fi.(FileInfoGetter); ok {
24
- return v.GetFileInfo()
+ sys := fi.Sys()
+ if v, ok := sys.(*FileInfo); ok {
+ return v
25
26
return getOSFileInfo(fi)
27
0 commit comments