Skip to content

Commit 0f5bb7e

Browse files
authored
Update golangci-lint to v1.56.2 (#1626)
1 parent b8162a3 commit 0f5bb7e

29 files changed

+209
-214
lines changed

api/v1beta2/ibmpowervsclustertemplate_webhook_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func TestIBMPowerVSClusterTemplate_ValidateUpdate(t *testing.T) {
7777
},
7878
}
7979
for _, test := range tests {
80-
t.Run(test.name, func(t *testing.T) {
80+
t.Run(test.name, func(_ *testing.T) {
8181
_, err := test.newTemplate.ValidateUpdate(test.oldTemplate)
8282
if test.wantErr {
8383
g.Expect(err).To(HaveOccurred())

cloud/scope/cluster_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func TestNewClusterScope(t *testing.T) {
8383
}
8484
for _, tc := range testCases {
8585
g := NewWithT(t)
86-
t.Run(tc.name, func(t *testing.T) {
86+
t.Run(tc.name, func(_ *testing.T) {
8787
_, err := NewClusterScope(tc.params)
8888
// Note: only error/failure cases covered
8989
// TO-DO: cover success cases

cloud/scope/machine_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func TestNewMachineScope(t *testing.T) {
105105
}
106106
for _, tc := range testCases {
107107
g := NewWithT(t)
108-
t.Run(tc.name, func(t *testing.T) {
108+
t.Run(tc.name, func(_ *testing.T) {
109109
_, err := NewMachineScope(tc.params)
110110
// Note: only error/failure cases covered
111111
// TO-DO: cover success cases

cloud/scope/powervs_cluster_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func TestNewPowerVSClusterScope(t *testing.T) {
5959
}
6060
for _, tc := range testCases {
6161
g := NewWithT(t)
62-
t.Run(tc.name, func(t *testing.T) {
62+
t.Run(tc.name, func(_ *testing.T) {
6363
_, err := NewPowerVSClusterScope(tc.params)
6464
// Note: only error/failure cases covered
6565
// TO-DO: cover success cases

cloud/scope/powervs_image_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func TestNewPowerVSImageScope(t *testing.T) {
9797
}
9898
for _, tc := range testCases {
9999
g := NewWithT(t)
100-
t.Run(tc.name, func(t *testing.T) {
100+
t.Run(tc.name, func(_ *testing.T) {
101101
_, err := NewPowerVSImageScope(tc.params)
102102
// Note: only error/failure cases covered
103103
// TO-DO: cover success cases

cloud/scope/powervs_machine_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func TestNewPowerVSMachineScope(t *testing.T) {
181181
}
182182
for _, tc := range testCases {
183183
g := NewWithT(t)
184-
t.Run(tc.name, func(t *testing.T) {
184+
t.Run(tc.name, func(_ *testing.T) {
185185
_, err := NewPowerVSMachineScope(tc.params)
186186
// Note: only error/failure cases covered
187187
// TO-DO: cover success cases

cmd/capibmadm/cmd/powervs/image/import.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ capibmadm powervs image import --service-instance-id <service-instance-id> -b <b
8585
_ = cmd.MarkFlagRequired("bucket-region")
8686
_ = cmd.MarkFlagRequired("name")
8787
_ = cmd.MarkFlagRequired("object")
88-
cmd.PreRunE = func(cmd *cobra.Command, args []string) error {
88+
cmd.PreRunE = func(_ *cobra.Command, _ []string) error {
8989
case1 := imageImportOption.AccessKey == "" && imageImportOption.SecretKey != ""
9090
case2 := imageImportOption.AccessKey != "" && imageImportOption.SecretKey == ""
9191

@@ -95,7 +95,7 @@ capibmadm powervs image import --service-instance-id <service-instance-id> -b <b
9595
return nil
9696
}
9797

98-
cmd.RunE = func(cmd *cobra.Command, args []string) error {
98+
cmd.RunE = func(cmd *cobra.Command, _ []string) error {
9999
return importimage(cmd.Context(), imageImportOption)
100100
}
101101

cmd/capibmadm/cmd/powervs/image/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func ListCommand() *cobra.Command {
4545
# List PowerVS images
4646
export IBMCLOUD_API_KEY=<api-key>
4747
capibmadm powervs image list --service-instance-id <service-instance-id> --zone <zone>`,
48-
RunE: func(cmd *cobra.Command, args []string) error {
48+
RunE: func(cmd *cobra.Command, _ []string) error {
4949
return listimage(cmd.Context())
5050
},
5151
}

cmd/capibmadm/cmd/powervs/key/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ Using file-path to SSH key : capibmadm powervs key create --name <key-name> --ke
6161

6262
// TODO: Flag validation is handled in PreRunE until the support for MarkFlagsMutuallyExclusiveAndRequired is available.
6363
// Related issue: https://github.com/spf13/cobra/issues/1216
64-
cmd.PreRunE = func(cmd *cobra.Command, args []string) error {
64+
cmd.PreRunE = func(_ *cobra.Command, _ []string) error {
6565
if (keyCreateOption.key == "") == (filePath == "") {
6666
return fmt.Errorf("the required flags either file-path of SSH key or the SSH key within double quotation marks")
6767
}
6868
return nil
6969
}
7070

71-
cmd.RunE = func(cmd *cobra.Command, args []string) error {
71+
cmd.RunE = func(cmd *cobra.Command, _ []string) error {
7272
if filePath != "" {
7373
sshKey, err := os.ReadFile(filePath) // #nosec
7474
if err != nil {

cmd/capibmadm/cmd/powervs/key/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ capibmadm powervs key delete --name <key-name> --service-instance-id <service-in
4646
cmd.Flags().StringVar(&keyName, "name", "", "The name of the SSH key.")
4747
_ = cmd.MarkFlagRequired("name")
4848

49-
cmd.RunE = func(cmd *cobra.Command, args []string) error {
49+
cmd.RunE = func(cmd *cobra.Command, _ []string) error {
5050
return deleteSSHKey(cmd.Context(), keyName)
5151
}
5252
return cmd

0 commit comments

Comments
 (0)