Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: update dependency golangci/golangci-lint #1034

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0 # renovate: datasource=github-releases depName=golangci/golangci-lint
version: v1.62.0 # renovate: datasource=github-releases depName=golangci/golangci-lint

# In general linting is quite fast with warm caches, but a fresh run might
# take some time.
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ build:

test:lint:
stage: test
image: golangci/golangci-lint:v1.61
image: golangci/golangci-lint:v1.62
script:
- golangci-lint run -v

Expand Down
4 changes: 2 additions & 2 deletions internal/floatingip/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,10 @@ func getFloatingIPAttributes(f *hcloud.FloatingIP) map[string]interface{} {
return res
}

func setProtection(ctx context.Context, c *hcloud.Client, f *hcloud.FloatingIP, delete bool) error {
func setProtection(ctx context.Context, c *hcloud.Client, f *hcloud.FloatingIP, deleteProtection bool) error {
action, _, err := c.FloatingIP.ChangeProtection(ctx, f,
hcloud.FloatingIPChangeProtectionOpts{
Delete: &delete,
Delete: &deleteProtection,
},
)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/loadbalancer/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,10 @@ func algorithmToTerraformAlgorithm(algorithm hcloud.LoadBalancerAlgorithm) (tfAl
return
}

func setProtection(ctx context.Context, c *hcloud.Client, lb *hcloud.LoadBalancer, delete bool) error {
func setProtection(ctx context.Context, c *hcloud.Client, lb *hcloud.LoadBalancer, deleteProtection bool) error {
action, _, err := c.LoadBalancer.ChangeProtection(ctx, lb,
hcloud.LoadBalancerChangeProtectionOpts{
Delete: &delete,
Delete: &deleteProtection,
},
)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/network/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ func getNetworkAttributes(n *hcloud.Network) map[string]interface{} {
}
}

func setProtection(ctx context.Context, c *hcloud.Client, n *hcloud.Network, delete bool) error {
func setProtection(ctx context.Context, c *hcloud.Client, n *hcloud.Network, deleteProtection bool) error {
action, _, err := c.Network.ChangeProtection(ctx, n,
hcloud.NetworkChangeProtectionOpts{
Delete: &delete,
Delete: &deleteProtection,
},
)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/primaryip/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ func getPrimaryIPAttributes(f *hcloud.PrimaryIP) map[string]interface{} {
return res
}

func setProtection(ctx context.Context, c *hcloud.Client, primaryIP *hcloud.PrimaryIP, delete bool) error {
func setProtection(ctx context.Context, c *hcloud.Client, primaryIP *hcloud.PrimaryIP, deleteProtection bool) error {
action, _, err := c.PrimaryIP.ChangeProtection(ctx,
hcloud.PrimaryIPChangeProtectionOpts{
ID: primaryIP.ID,
Delete: delete,
Delete: deleteProtection,
},
)
if err != nil {
Expand Down
20 changes: 10 additions & 10 deletions internal/server/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ func Resource() *schema.Resource {
Optional: true,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeInt},
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { // nolint:revive
DiffSuppressFunc: func(k, oldValue, newValue string, d *schema.ResourceData) bool { // nolint:revive
sup := d.Get("ignore_remote_firewall_ids").(bool)
if sup && old != "" && new != "" {
if sup && oldValue != "" && newValue != "" {
return true
}
return false
Expand Down Expand Up @@ -274,14 +274,14 @@ func userDataHashSum(userData string) string {
return base64.StdEncoding.EncodeToString(sum[:])
}

func userDataDiffSuppress(k, old, new string, d *schema.ResourceData) bool {
func userDataDiffSuppress(k, oldValue, newValue string, d *schema.ResourceData) bool {
userData := d.Get(k).(string)
if new != "" && userData != "" {
if _, err := base64.StdEncoding.DecodeString(old); err != nil {
return userDataHashSum(old) == new
if newValue != "" && userData != "" {
if _, err := base64.StdEncoding.DecodeString(oldValue); err != nil {
return userDataHashSum(oldValue) == newValue
}
}
return strings.TrimSpace(old) == strings.TrimSpace(new)
return strings.TrimSpace(oldValue) == strings.TrimSpace(newValue)
}

func resourceServerCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
Expand Down Expand Up @@ -1286,11 +1286,11 @@ func setPlacementGroup(ctx context.Context, c *hcloud.Client, server *hcloud.Ser
return nil
}

func setProtection(ctx context.Context, c *hcloud.Client, server *hcloud.Server, delete bool, rebuild bool) error {
func setProtection(ctx context.Context, c *hcloud.Client, server *hcloud.Server, deleteProtection bool, rebuildProtection bool) error {
action, _, err := c.Server.ChangeProtection(ctx, server,
hcloud.ServerChangeProtectionOpts{
Delete: &delete,
Rebuild: &rebuild,
Delete: &deleteProtection,
Rebuild: &rebuildProtection,
},
)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions internal/server/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1080,10 +1080,10 @@ func TestServerResource_EmptySSHKey(t *testing.T) {
})
}

func isRecreated(new, old *hcloud.Server) func() error {
func isRecreated(newServer, oldServer *hcloud.Server) func() error {
return func() error {
if new.ID == old.ID {
return fmt.Errorf("new server is the same as server cert %d", old.ID)
if newServer.ID == oldServer.ID {
return fmt.Errorf("new server is the same as server cert %d", oldServer.ID)
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions internal/volume/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,10 @@ func getVolumeAttributes(v *hcloud.Volume) map[string]interface{} {
return res
}

func setProtection(ctx context.Context, c *hcloud.Client, v *hcloud.Volume, delete bool) error {
func setProtection(ctx context.Context, c *hcloud.Client, v *hcloud.Volume, deleteProtection bool) error {
action, _, err := c.Volume.ChangeProtection(ctx, v,
hcloud.VolumeChangeProtectionOpts{
Delete: &delete,
Delete: &deleteProtection,
},
)
if err != nil {
Expand Down
Loading