sysfs: return st instead of accepting it (#1261)
This returns stat as a value instead of a pointer param. This is both more efficient and faster. It is also more efficient than returning a pointer to a stat. Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -141,13 +141,13 @@ func maskForReads(f fs.File) fs.File {
|
||||
}
|
||||
|
||||
// Lstat implements FS.Lstat
|
||||
func (r *readFS) Lstat(path string, lstat *platform.Stat_t) error {
|
||||
return r.fs.Lstat(path, lstat)
|
||||
func (r *readFS) Lstat(path string) (platform.Stat_t, error) {
|
||||
return r.fs.Lstat(path)
|
||||
}
|
||||
|
||||
// Stat implements FS.Stat
|
||||
func (r *readFS) Stat(path string, stat *platform.Stat_t) error {
|
||||
return r.fs.Stat(path, stat)
|
||||
func (r *readFS) Stat(path string) (platform.Stat_t, error) {
|
||||
return r.fs.Stat(path)
|
||||
}
|
||||
|
||||
// Readlink implements FS.Readlink
|
||||
|
||||
Reference in New Issue
Block a user