mirror of
https://github.com/rclone/rclone.git
synced 2025-08-19 09:52:05 +02:00
Fix lint issues reported by staticcheck
Used staticcheck 2022.1.2 (v0.3.2) See: staticcheck.io
This commit is contained in:
@@ -903,22 +903,20 @@ func (f *Fs) netStorageStatRequest(ctx context.Context, URL string, directory bo
|
||||
files = statResp.Files
|
||||
f.setStatCache(URL, files)
|
||||
}
|
||||
if files != nil {
|
||||
// Multiple objects can be returned with the "slash=both" option,
|
||||
// when file/symlink/directory has the same name
|
||||
for i := range files {
|
||||
if files[i].Type == "symlink" {
|
||||
// Add .rclonelink suffix to allow local backend code to convert to a symlink.
|
||||
files[i].Name += ".rclonelink"
|
||||
fs.Infof(nil, "Converting a symlink to the rclonelink on the stat request %s", files[i].Name)
|
||||
}
|
||||
entrywanted := (directory && files[i].Type == "dir") ||
|
||||
(!directory && files[i].Type != "dir")
|
||||
if entrywanted {
|
||||
filestamp := files[0]
|
||||
files[0] = files[i]
|
||||
files[i] = filestamp
|
||||
}
|
||||
// Multiple objects can be returned with the "slash=both" option,
|
||||
// when file/symlink/directory has the same name
|
||||
for i := range files {
|
||||
if files[i].Type == "symlink" {
|
||||
// Add .rclonelink suffix to allow local backend code to convert to a symlink.
|
||||
files[i].Name += ".rclonelink"
|
||||
fs.Infof(nil, "Converting a symlink to the rclonelink on the stat request %s", files[i].Name)
|
||||
}
|
||||
entrywanted := (directory && files[i].Type == "dir") ||
|
||||
(!directory && files[i].Type != "dir")
|
||||
if entrywanted {
|
||||
filestamp := files[0]
|
||||
files[0] = files[i]
|
||||
files[i] = filestamp
|
||||
}
|
||||
}
|
||||
return files, nil
|
||||
|
Reference in New Issue
Block a user