address issues flagged by linter
This commit is contained in:
parent
403783d851
commit
976ce2499c
7 changed files with 14 additions and 8 deletions
|
@ -3,13 +3,14 @@ package copy
|
|||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/rclone/rclone/cmd"
|
||||
"github.com/rclone/rclone/fs/config/flags"
|
||||
"github.com/rclone/rclone/fs/operations"
|
||||
"github.com/rclone/rclone/fs/operations/operationsflags"
|
||||
"github.com/rclone/rclone/fs/sync"
|
||||
"github.com/spf13/cobra"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -3,10 +3,10 @@ package copyto
|
|||
|
||||
import (
|
||||
"context"
|
||||
"github.com/rclone/rclone/fs/operations/operationsflags"
|
||||
|
||||
"github.com/rclone/rclone/cmd"
|
||||
"github.com/rclone/rclone/fs/operations"
|
||||
"github.com/rclone/rclone/fs/operations/operationsflags"
|
||||
"github.com/rclone/rclone/fs/sync"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
|
|
@ -3,12 +3,12 @@ package move
|
|||
|
||||
import (
|
||||
"context"
|
||||
"github.com/rclone/rclone/fs/operations/operationsflags"
|
||||
"strings"
|
||||
|
||||
"github.com/rclone/rclone/cmd"
|
||||
"github.com/rclone/rclone/fs/config/flags"
|
||||
"github.com/rclone/rclone/fs/operations"
|
||||
"github.com/rclone/rclone/fs/operations/operationsflags"
|
||||
"github.com/rclone/rclone/fs/sync"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
@ -92,9 +92,9 @@ for more info.
|
|||
}
|
||||
|
||||
if srcFileName == "" {
|
||||
return sync.MoveDir(context.Background(), fdst, fsrc, deleteEmptySrcDirs, createEmptySrcDirs)
|
||||
return sync.MoveDir(ctx, fdst, fsrc, deleteEmptySrcDirs, createEmptySrcDirs)
|
||||
}
|
||||
return operations.MoveFile(context.Background(), fdst, fsrc, srcFileName, srcFileName)
|
||||
return operations.MoveFile(ctx, fdst, fsrc, srcFileName, srcFileName)
|
||||
})
|
||||
},
|
||||
}
|
||||
|
|
|
@ -3,10 +3,10 @@ package moveto
|
|||
|
||||
import (
|
||||
"context"
|
||||
"github.com/rclone/rclone/fs/operations/operationsflags"
|
||||
|
||||
"github.com/rclone/rclone/cmd"
|
||||
"github.com/rclone/rclone/fs/operations"
|
||||
"github.com/rclone/rclone/fs/operations/operationsflags"
|
||||
"github.com/rclone/rclone/fs/sync"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
|
|
@ -3,6 +3,7 @@ package sync
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rclone/rclone/cmd"
|
||||
"github.com/rclone/rclone/fs/config/flags"
|
||||
"github.com/rclone/rclone/fs/operations"
|
||||
|
|
|
@ -107,6 +107,7 @@ type LoggerOpt struct {
|
|||
Absolute bool
|
||||
}
|
||||
|
||||
// NewDefaultLoggerFn creates a logger function that writes the sigil and path to configured files that match the sigil
|
||||
func NewDefaultLoggerFn(opt *LoggerOpt) LoggerFn {
|
||||
var lock mutex.Mutex
|
||||
|
||||
|
|
|
@ -4,14 +4,15 @@ package operationsflags
|
|||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fs/config/flags"
|
||||
"github.com/rclone/rclone/fs/hash"
|
||||
"github.com/rclone/rclone/fs/operations"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/pflag"
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
|
||||
// AddLoggerFlagsOptions contains options for the Logger Flags
|
||||
|
@ -25,6 +26,7 @@ type AddLoggerFlagsOptions struct {
|
|||
DestAfter string // files that exist on the destination post-sync
|
||||
}
|
||||
|
||||
// AnySet checks if any of the logger flags have a non-blank value
|
||||
func (o AddLoggerFlagsOptions) AnySet() bool {
|
||||
return anyNotBlank(o.Combined, o.MissingOnSrc, o.MissingOnDst, o.Match, o.Differ, o.ErrFile, o.DestAfter)
|
||||
}
|
||||
|
@ -62,6 +64,7 @@ func AddLoggerFlags(cmdFlags *pflag.FlagSet, opt *operations.LoggerOpt, flagsOpt
|
|||
// flags.BoolVarP(cmdFlags, &recurse, "recursive", "R", false, "Recurse into the listing", "")
|
||||
}
|
||||
|
||||
// ConfigureLoggers verifies and sets up writers for log files requested via CLI flags
|
||||
func ConfigureLoggers(ctx context.Context, fdst fs.Fs, command *cobra.Command, opt *operations.LoggerOpt, flagsOpt AddLoggerFlagsOptions) (func(), error) {
|
||||
closers := []io.Closer{}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue