mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
build: fix gocritic lint issue elseif
This commit is contained in:
committed by
Nick Craig-Wood
parent
4454ed9d3b
commit
e82b5b11af
@@ -1865,14 +1865,12 @@ func BackupDir(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, srcFileName string)
|
||||
if OverlappingFilterCheck(ctx, backupDir, fsrc) {
|
||||
return nil, fserrors.FatalError(errors.New("source and parameter to --backup-dir mustn't overlap"))
|
||||
}
|
||||
} else {
|
||||
if ci.Suffix == "" {
|
||||
if SameDir(fdst, backupDir) {
|
||||
return nil, fserrors.FatalError(errors.New("destination and parameter to --backup-dir mustn't be the same"))
|
||||
}
|
||||
if SameDir(fsrc, backupDir) {
|
||||
return nil, fserrors.FatalError(errors.New("source and parameter to --backup-dir mustn't be the same"))
|
||||
}
|
||||
} else if ci.Suffix == "" {
|
||||
if SameDir(fdst, backupDir) {
|
||||
return nil, fserrors.FatalError(errors.New("destination and parameter to --backup-dir mustn't be the same"))
|
||||
}
|
||||
if SameDir(fsrc, backupDir) {
|
||||
return nil, fserrors.FatalError(errors.New("source and parameter to --backup-dir mustn't be the same"))
|
||||
}
|
||||
}
|
||||
} else if ci.Suffix != "" {
|
||||
@@ -2041,15 +2039,13 @@ func moveOrCopyFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName str
|
||||
}
|
||||
|
||||
_, err = Op(ctx, fdst, dstObj, dstFileName, srcObj)
|
||||
} else {
|
||||
if !cp {
|
||||
if ci.IgnoreExisting {
|
||||
fs.Debugf(srcObj, "Not removing source file as destination file exists and --ignore-existing is set")
|
||||
logger(ctx, Match, srcObj, dstObj, nil)
|
||||
} else if !SameObject(srcObj, dstObj) {
|
||||
err = DeleteFile(ctx, srcObj)
|
||||
logger(ctx, Differ, srcObj, dstObj, nil)
|
||||
}
|
||||
} else if !cp {
|
||||
if ci.IgnoreExisting {
|
||||
fs.Debugf(srcObj, "Not removing source file as destination file exists and --ignore-existing is set")
|
||||
logger(ctx, Match, srcObj, dstObj, nil)
|
||||
} else if !SameObject(srcObj, dstObj) {
|
||||
err = DeleteFile(ctx, srcObj)
|
||||
logger(ctx, Differ, srcObj, dstObj, nil)
|
||||
}
|
||||
}
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user