Skip to content

Commit

Permalink
go.mk: lint with staticcheck (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
sauterp authored Jun 11, 2024
1 parent 63fe767 commit 749b629
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 41 deletions.
30 changes: 0 additions & 30 deletions .golangci.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ IMPROVEMENTS:
IMPROVEMENTS

- SKS: document dependency of CSI on CCM #359
- go.mk: lint with staticcheck #364

BUG FIXES

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GO_MK_REF := v1.0.0
GO_MK_REF := v2.0.0

# make go.mk a dependency for all targets
.EXTRA_PREREQS = go.mk
Expand Down
2 changes: 1 addition & 1 deletion exoscale/datasource_exoscale_elastic_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func dataSourceElasticIPRead(ctx context.Context, d *schema.ResourceData, meta i
}

if elasticIP == nil {
return diag.FromErr(fmt.Errorf("Unable to find matching ElasticIP"))
return diag.FromErr(fmt.Errorf("unable to find matching ElasticIP"))
}

d.SetId(*elasticIP.ID)
Expand Down
5 changes: 2 additions & 3 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"time"

egoscale "github.com/exoscale/egoscale/v2"
exov3 "github.com/exoscale/egoscale/v3"
v3 "github.com/exoscale/egoscale/v3"
)

Expand Down Expand Up @@ -44,10 +43,10 @@ func GetClient(meta interface{}) (*egoscale.Client, error) {
}

// GetClientV3 builds egoscale v3 client from configuration parameters in meta field
func GetClientV3(meta interface{}) (*exov3.Client, error) {
func GetClientV3(meta interface{}) (*v3.Client, error) {
c := meta.(map[string]interface{})
if client, ok := c["clientV3"]; ok {
return client.(*exov3.Client), nil
return client.(*v3.Client), nil
}
return nil, errors.New("API client not found")
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/testutils/api_validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func CheckInstanceDestroy(testInstance *egoscale.Instance) resource.TestCheckFun
return err
}

return errors.New("Compute testInstance still exists")
return errors.New("compute testInstance still exists")
}
}

Expand Down Expand Up @@ -180,7 +180,7 @@ func CheckSecurityGroupDestroy(securityGroup *egoscale.SecurityGroup) resource.T
return err
}

return errors.New("Security Group still exists")
return errors.New("security Group still exists")
}
}

Expand Down Expand Up @@ -232,7 +232,7 @@ func CheckPrivateNetworkDestroy(privateNetwork *egoscale.PrivateNetwork) resourc
return err
}

return errors.New("Private Network still exists")
return errors.New("private Network still exists")
}
}

Expand Down Expand Up @@ -284,7 +284,7 @@ func CheckElasticIPDestroy(elasticIP *egoscale.ElasticIP) resource.TestCheckFunc
return err
}

return errors.New("Elastic IP still exists")
return errors.New("elastic IP still exists")
}
}

Expand Down Expand Up @@ -396,7 +396,7 @@ func CheckInstancePoolDestroy(pool *egoscale.InstancePool) resource.TestCheckFun
return nil
}

return errors.New("Instance Pool still exists")
return errors.New("instance Pool still exists")
}),
repeat.StopOnSuccess(),
repeat.LimitMaxTries(10),
Expand Down
2 changes: 1 addition & 1 deletion pkg/testutils/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func CheckResourceAttributes(want TestAttrs, got map[string]string) error {
}
}

return fmt.Errorf("invalid value for attribute %q:\n%s\n", // nolint:revive
return fmt.Errorf("invalid value for attribute %q:\n%s\n", //lint:ignore ST1005 it's more readable with newlines
attr, strings.Join(errors, "\n"))
}
}
Expand Down

0 comments on commit 749b629

Please sign in to comment.