Fix lint failures: Check return types (#338)

This commit is contained in:
Vaibhav Kamra 2022-07-13 14:43:42 -07:00 committed by GitHub
parent 39c85e1a84
commit 6f9fe0dd9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,14 +28,14 @@ var backupCmd = &cobra.Command{
Use: "backup", Use: "backup",
Short: "Backup your service data", Short: "Backup your service data",
Long: `Backup the data stored in one of your M365 services.`, Long: `Backup the data stored in one of your M365 services.`,
Run: handleBackupCmd, RunE: handleBackupCmd,
Args: cobra.NoArgs, Args: cobra.NoArgs,
} }
// Handler for flat calls to `corso backup`. // Handler for flat calls to `corso backup`.
// Produces the same output as `corso backup --help`. // Produces the same output as `corso backup --help`.
func handleBackupCmd(cmd *cobra.Command, args []string) { func handleBackupCmd(cmd *cobra.Command, args []string) error {
cmd.Help() return cmd.Help()
} }
// The backup create subcommand. // The backup create subcommand.
@ -44,14 +44,14 @@ var createCommand = "create"
var createCmd = &cobra.Command{ var createCmd = &cobra.Command{
Use: createCommand, Use: createCommand,
Short: "Backup an M365 Service", Short: "Backup an M365 Service",
Run: handleCreateCmd, RunE: handleCreateCmd,
Args: cobra.NoArgs, Args: cobra.NoArgs,
} }
// Handler for calls to `corso backup create`. // Handler for calls to `corso backup create`.
// Produces the same output as `corso backup create --help`. // Produces the same output as `corso backup create --help`.
func handleCreateCmd(cmd *cobra.Command, args []string) { func handleCreateCmd(cmd *cobra.Command, args []string) error {
cmd.Help() return cmd.Help()
} }
// The backup list subcommand. // The backup list subcommand.
@ -60,14 +60,14 @@ var listCommand = "list"
var listCmd = &cobra.Command{ var listCmd = &cobra.Command{
Use: listCommand, Use: listCommand,
Short: "List the history of backups for a service", Short: "List the history of backups for a service",
Run: handleListCmd, RunE: handleListCmd,
Args: cobra.NoArgs, Args: cobra.NoArgs,
} }
// Handler for calls to `corso backup list`. // Handler for calls to `corso backup list`.
// Produces the same output as `corso backup list --help`. // Produces the same output as `corso backup list --help`.
func handleListCmd(cmd *cobra.Command, args []string) { func handleListCmd(cmd *cobra.Command, args []string) error {
cmd.Help() return cmd.Help()
} }
// The backup details subcommand. // The backup details subcommand.
@ -76,12 +76,12 @@ var detailsCommand = "details"
var detailsCmd = &cobra.Command{ var detailsCmd = &cobra.Command{
Use: detailsCommand, Use: detailsCommand,
Short: "Shows the details of a backup for a service", Short: "Shows the details of a backup for a service",
Run: handleDetailsCmd, RunE: handleDetailsCmd,
Args: cobra.NoArgs, Args: cobra.NoArgs,
} }
// Handler for calls to `corso backup details`. // Handler for calls to `corso backup details`.
// Produces the same output as `corso backup details --help`. // Produces the same output as `corso backup details --help`.
func handleDetailsCmd(cmd *cobra.Command, args []string) { func handleDetailsCmd(cmd *cobra.Command, args []string) error {
cmd.Help() return cmd.Help()
} }