mirror of
https://github.com/octoleo/restic.git
synced 2024-12-23 03:18:55 +00:00
Merge pull request #3421 from greatroar/s3-fileinfo
Return s3.fileInfos by pointer
This commit is contained in:
commit
a476752962
@ -186,12 +186,12 @@ type fileInfo struct {
|
|||||||
isDir bool
|
isDir bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fi fileInfo) Name() string { return fi.name } // base name of the file
|
func (fi *fileInfo) Name() string { return fi.name } // base name of the file
|
||||||
func (fi fileInfo) Size() int64 { return fi.size } // length in bytes for regular files; system-dependent for others
|
func (fi *fileInfo) Size() int64 { return fi.size } // length in bytes for regular files; system-dependent for others
|
||||||
func (fi fileInfo) Mode() os.FileMode { return fi.mode } // file mode bits
|
func (fi *fileInfo) Mode() os.FileMode { return fi.mode } // file mode bits
|
||||||
func (fi fileInfo) ModTime() time.Time { return fi.modTime } // modification time
|
func (fi *fileInfo) ModTime() time.Time { return fi.modTime } // modification time
|
||||||
func (fi fileInfo) IsDir() bool { return fi.isDir } // abbreviation for Mode().IsDir()
|
func (fi *fileInfo) IsDir() bool { return fi.isDir } // abbreviation for Mode().IsDir()
|
||||||
func (fi fileInfo) Sys() interface{} { return nil } // underlying data source (can return nil)
|
func (fi *fileInfo) Sys() interface{} { return nil } // underlying data source (can return nil)
|
||||||
|
|
||||||
// ReadDir returns the entries for a directory.
|
// ReadDir returns the entries for a directory.
|
||||||
func (be *Backend) ReadDir(ctx context.Context, dir string) (list []os.FileInfo, err error) {
|
func (be *Backend) ReadDir(ctx context.Context, dir string) (list []os.FileInfo, err error) {
|
||||||
@ -225,7 +225,7 @@ func (be *Backend) ReadDir(ctx context.Context, dir string) (list []os.FileInfo,
|
|||||||
if name == "" {
|
if name == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
entry := fileInfo{
|
entry := &fileInfo{
|
||||||
name: name,
|
name: name,
|
||||||
size: obj.Size,
|
size: obj.Size,
|
||||||
modTime: obj.LastModified,
|
modTime: obj.LastModified,
|
||||||
|
Loading…
Reference in New Issue
Block a user