diff --git a/cmd/account.go b/cmd/account.go index a91cda63..bdbb01e6 100644 --- a/cmd/account.go +++ b/cmd/account.go @@ -16,6 +16,7 @@ package cmd import ( "context" + "errors" "fmt" "os" @@ -39,7 +40,7 @@ var accountCmd = &cobra.Command{ }, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/backups.go b/cmd/backups.go index 77d88056..028c1b38 100644 --- a/cmd/backups.go +++ b/cmd/backups.go @@ -32,7 +32,7 @@ func Backups() *cobra.Command { Short: "Display backups", PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/bareMetal.go b/cmd/bareMetal.go index d640f224..692f0c2f 100644 --- a/cmd/bareMetal.go +++ b/cmd/bareMetal.go @@ -64,7 +64,7 @@ func BareMetal() *cobra.Command { Example: bareMetalExample, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/billing.go b/cmd/billing.go index 6cb8e450..2132ebf6 100644 --- a/cmd/billing.go +++ b/cmd/billing.go @@ -96,7 +96,7 @@ func Billing() *cobra.Command { Example: billingExample, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/blockStorage.go b/cmd/blockStorage.go index 4d7bb3ea..cfb1c7c0 100644 --- a/cmd/blockStorage.go +++ b/cmd/blockStorage.go @@ -114,7 +114,7 @@ func BlockStorageCmd() *cobra.Command { Long: `block-storage is used to interact with the block-storage api`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/database.go b/cmd/database.go index 9df2efdc..77e96483 100644 --- a/cmd/database.go +++ b/cmd/database.go @@ -68,7 +68,7 @@ func Database() *cobra.Command { //nolint:funlen Example: databaseExample, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/dns.go b/cmd/dns.go index 8d184e83..fd0202a4 100644 --- a/cmd/dns.go +++ b/cmd/dns.go @@ -15,7 +15,7 @@ package cmd import ( - "fmt" + "errors" "github.com/spf13/cobra" ) @@ -28,7 +28,7 @@ func DNS() *cobra.Command { Long: ``, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/firewall.go b/cmd/firewall.go index ff3b125f..3093917a 100644 --- a/cmd/firewall.go +++ b/cmd/firewall.go @@ -15,7 +15,7 @@ package cmd import ( - "fmt" + "errors" "github.com/spf13/cobra" ) @@ -29,7 +29,7 @@ func Firewall() *cobra.Command { Aliases: []string{"fw"}, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/instance.go b/cmd/instance.go index 994a30e8..c2d16c7f 100644 --- a/cmd/instance.go +++ b/cmd/instance.go @@ -97,7 +97,7 @@ func Instance() *cobra.Command { //nolint: funlen,gocyclo Example: instanceExample, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/iso.go b/cmd/iso.go index 5972fb1d..c27e7d30 100644 --- a/cmd/iso.go +++ b/cmd/iso.go @@ -34,7 +34,7 @@ func ISO() *cobra.Command { Long: ``, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/kubernetes.go b/cmd/kubernetes.go index 86426c2a..ac0066a7 100644 --- a/cmd/kubernetes.go +++ b/cmd/kubernetes.go @@ -231,7 +231,7 @@ func Kubernetes() *cobra.Command { //nolint: funlen Example: kubernetesExample, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/loadBalancer.go b/cmd/loadBalancer.go index 5b148b83..badd3823 100644 --- a/cmd/loadBalancer.go +++ b/cmd/loadBalancer.go @@ -88,7 +88,7 @@ func LoadBalancer() *cobra.Command { //nolint: funlen Example: lbExample, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/network.go b/cmd/network.go index 5cfabcb8..53acc261 100644 --- a/cmd/network.go +++ b/cmd/network.go @@ -42,7 +42,7 @@ func Network() *cobra.Command { Deprecated: "Use vpc instead.", PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/objectStorage.go b/cmd/objectStorage.go index 80af1583..ef1abc17 100644 --- a/cmd/objectStorage.go +++ b/cmd/objectStorage.go @@ -33,7 +33,7 @@ func ObjectStorageCmd() *cobra.Command { Long: `object-storage is used to interact with the object-storage api`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/reservedIP.go b/cmd/reservedIP.go index 22584fa3..a7575d4b 100644 --- a/cmd/reservedIP.go +++ b/cmd/reservedIP.go @@ -115,7 +115,7 @@ func ReservedIP() *cobra.Command { Example: reservedIPExample, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/script.go b/cmd/script.go index 0dfdf7ef..835a7b3c 100644 --- a/cmd/script.go +++ b/cmd/script.go @@ -34,7 +34,7 @@ func Script() *cobra.Command { Long: `script is used to access startup script commands`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/snapshot.go b/cmd/snapshot.go index c6a4aa70..b951ffe7 100644 --- a/cmd/snapshot.go +++ b/cmd/snapshot.go @@ -34,7 +34,7 @@ func Snapshot() *cobra.Command { Long: `snapshot is used to access snapshot commands`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/sshKey.go b/cmd/sshKey.go index 8f1fbfda..edaa7ee3 100644 --- a/cmd/sshKey.go +++ b/cmd/sshKey.go @@ -34,7 +34,7 @@ func SSHKey() *cobra.Command { Long: `ssh-key is used to access SSH key commands`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/user.go b/cmd/user.go index 438a6ed5..2e130a15 100644 --- a/cmd/user.go +++ b/cmd/user.go @@ -34,7 +34,7 @@ func User() *cobra.Command { Long: `user is used to access user commands`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/vpc.go b/cmd/vpc.go index f96aa097..53b4f700 100644 --- a/cmd/vpc.go +++ b/cmd/vpc.go @@ -84,7 +84,7 @@ func VPC() *cobra.Command { Example: vpcExample, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil }, diff --git a/cmd/vpc2.go b/cmd/vpc2.go index 8eadfdba..af4eb9fb 100644 --- a/cmd/vpc2.go +++ b/cmd/vpc2.go @@ -64,7 +64,7 @@ func VPC2() *cobra.Command { Example: vpc2Example, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if auth := cmd.Context().Value("authenticated"); auth != true { - return fmt.Errorf(apiKeyError) + return errors.New(apiKeyError) } return nil },