Address issues flagged by golangci-lint (#341)

This commit is contained in:
Vaibhav Kamra 2022-07-13 15:21:04 -07:00 committed by GitHub
parent 6f9fe0dd9e
commit c1c9cfe118
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 11 deletions

View File

@ -43,13 +43,13 @@ var initCmd = &cobra.Command{
Use: initCommand,
Short: "Initialize a repository.",
Long: `Create a new repository to store your backups.`,
Run: handleInitCmd,
RunE: handleInitCmd,
Args: cobra.NoArgs,
}
// Handler for calls to `corso repo init`.
func handleInitCmd(cmd *cobra.Command, args []string) {
cmd.Help()
func handleInitCmd(cmd *cobra.Command, args []string) error {
return cmd.Help()
}
// The repo connect subcommand.
@ -59,11 +59,11 @@ var connectCmd = &cobra.Command{
Use: connectCommand,
Short: "Connect to a repository.",
Long: `Connect to an existing repository.`,
Run: handleConnectCmd,
RunE: handleConnectCmd,
Args: cobra.NoArgs,
}
// Handler for calls to `corso repo connect`.
func handleConnectCmd(cmd *cobra.Command, args []string) {
cmd.Help()
func handleConnectCmd(cmd *cobra.Command, args []string) error {
return cmd.Help()
}

View File

@ -428,13 +428,11 @@ func walkDirectory(
return err
}
switch e.(type) {
switch e := e.(type) {
case fs.Directory:
d := e.(fs.Directory)
dirs = append(dirs, d)
dirs = append(dirs, e)
case fs.File:
f := e.(fs.File)
files = append(files, f)
files = append(files, e)
default:
errs = multierror.Append(errs, errors.Errorf("unexpected item type %T", e))
logger.Ctx(ctx).Warnf("unexpected item of type %T; skipping", e)