mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
os: turn FileStat.Sys into a method on FileInfo
This reduces the overhead necessary to work with OS-specific file details, hides the implementation of FileStat, and preserves the implementation-specific nature of Sys. Expressions such as: stat.(*os.FileInfo).Sys.(*syscall.Stat_t).Uid fi1.(*os.FileStat).SameFile(fi2.(*os.FileStat)) Are now spelled as:: stat.Sys().(*syscall.Stat_t).Uid os.SameFile(fi1, fi2) R=cw, bradfitz, rsc CC=golang-dev https://golang.org/cl/5448079
This commit is contained in:
parent
b9474de2be
commit
20f4385af0
18 changed files with 90 additions and 75 deletions
|
|
@ -152,7 +152,7 @@ func (f *File) readdir(n int) (fi []FileInfo, err error) {
|
|||
if err == nil {
|
||||
fi[i] = fip
|
||||
} else {
|
||||
fi[i] = &FileStat{name: filename}
|
||||
fi[i] = &fileStat{name: filename}
|
||||
}
|
||||
}
|
||||
return fi, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue