Skip to content

Commit 7e310a5

Browse files
authored
Merge branch 'master' into gofumpt
2 parents 7b58001 + 0be00df commit 7e310a5

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

.golangci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ linters:
4242
- noctx # noctx finds sending http request without context.Context [fast: false, auto-fix: false]
4343
- nolintlint # Reports ill-formed or insufficient nolint directives [fast: true, auto-fix: false]
4444
- nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL. [fast: true, auto-fix: false]
45+
- predeclared # find code that shadows one of Go's predeclared identifiers [fast: true, auto-fix: false]
4546
- promlinter # Check Prometheus metrics naming via promlint [fast: true, auto-fix: false]
4647
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. [fast: false, auto-fix: false]
4748
- rowserrcheck # checks whether Err of rows is checked successfully [fast: false, auto-fix: false]
@@ -83,7 +84,6 @@ linters:
8384
- nonamedreturns # Reports all named returns [fast: true, auto-fix: false]
8485
- paralleltest # paralleltest detects missing usage of t.Parallel() method in your Go test [fast: true, auto-fix: false]
8586
- prealloc # Finds slice declarations that could potentially be preallocated [fast: true, auto-fix: false]
86-
- predeclared # find code that shadows one of Go's predeclared identifiers [fast: true, auto-fix: false]
8787
- staticcheck #(megacheck): Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: false, auto-fix: false]
8888
- unparam # Reports unused function parameters [fast: false, auto-fix: false]
8989
- unused #(megacheck): Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false]

scaleway/helpers.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -541,30 +541,30 @@ func flattenMap(m map[string]string) interface{} {
541541
return flattenedMap
542542
}
543543

544-
func diffSuppressFuncDuration(k, old, new string, d *schema.ResourceData) bool {
545-
if old == new {
544+
func diffSuppressFuncDuration(k, oldValue, newValue string, d *schema.ResourceData) bool {
545+
if oldValue == newValue {
546546
return true
547547
}
548-
d1, err1 := time.ParseDuration(old)
549-
d2, err2 := time.ParseDuration(new)
548+
d1, err1 := time.ParseDuration(oldValue)
549+
d2, err2 := time.ParseDuration(newValue)
550550
if err1 != nil || err2 != nil {
551551
return false
552552
}
553553
return d1 == d2
554554
}
555555

556-
func diffSuppressFuncIgnoreCase(k, old, new string, d *schema.ResourceData) bool {
557-
return strings.EqualFold(old, new)
556+
func diffSuppressFuncIgnoreCase(k, oldValue, newValue string, d *schema.ResourceData) bool {
557+
return strings.EqualFold(oldValue, newValue)
558558
}
559559

560-
func diffSuppressFuncIgnoreCaseAndHyphen(k, old, new string, d *schema.ResourceData) bool {
561-
return strings.Replace(strings.ToLower(old), "-", "_", -1) == strings.Replace(strings.ToLower(new), "-", "_", -1)
560+
func diffSuppressFuncIgnoreCaseAndHyphen(k, oldValue, newValue string, d *schema.ResourceData) bool {
561+
return strings.Replace(strings.ToLower(oldValue), "-", "_", -1) == strings.Replace(strings.ToLower(newValue), "-", "_", -1)
562562
}
563563

564564
// diffSuppressFuncLocality is a SuppressDiffFunc to remove the locality from an ID when checking diff.
565565
// e.g. 2c1a1716-5570-4668-a50a-860c90beabf6 == fr-par-1/2c1a1716-5570-4668-a50a-860c90beabf6
566-
func diffSuppressFuncLocality(k, old, new string, d *schema.ResourceData) bool {
567-
return expandID(old) == expandID(new)
566+
func diffSuppressFuncLocality(k, oldValue, newValue string, d *schema.ResourceData) bool {
567+
return expandID(oldValue) == expandID(newValue)
568568
}
569569

570570
// TimedOut returns true if the error represents a "wait timed out" condition.

scaleway/resource_account_ssh_key.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ func resourceScalewayAccountSSKKey() *schema.Resource {
3434
ForceNew: true,
3535
Description: "The public SSH key",
3636
// We don't consider trailing \n as diff
37-
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
38-
return strings.Trim(old, "\n") == strings.Trim(new, "\n")
37+
DiffSuppressFunc: func(k, oldValue, newValue string, d *schema.ResourceData) bool {
38+
return strings.Trim(oldValue, "\n") == strings.Trim(newValue, "\n")
3939
},
4040
},
4141
"organization_id": organizationIDSchema(),

0 commit comments

Comments
 (0)