Skip to content

Commit 2a024e6

Browse files
authored
chore: add support for unused (#2716)
1 parent 4061d10 commit 2a024e6

File tree

4 files changed

+1
-37
lines changed

4 files changed

+1
-37
lines changed

.golangci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ linters:
6767
- tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes [fast: false, auto-fix: false]
6868
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code [fast: false, auto-fix: false]
6969
- unconvert # Remove unnecessary type conversions [fast: false, auto-fix: false]
70+
- unused #(megacheck): Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false]
7071
- usestdlibvars # A linter that detect the possibility to use variables/constants from the Go standard library. [fast: true, auto-fix: false]
7172
- wastedassign # wastedassign finds wasted assignment statements. [fast: false, auto-fix: false]
7273
- whitespace # Tool for detection of leading and trailing whitespace [fast: true, auto-fix: true]
@@ -94,7 +95,6 @@ linters:
9495
- nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value. [fast: false, auto-fix: false]
9596
- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity [fast: true, auto-fix: false]
9697
- staticcheck #(megacheck): Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: false, auto-fix: false]
97-
- unused #(megacheck): Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false]
9898
- varnamelen # checks that the length of a variable's name matches its scope [fast: false, auto-fix: false]
9999
- wsl # Whitespace Linter - Forces you to use empty lines! [fast: true, auto-fix: false]
100100

internal/services/iam/ssh_key.go

-8
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,3 @@ func resourceIamSSKKeyDelete(ctx context.Context, d *schema.ResourceData, m inte
192192

193193
return nil
194194
}
195-
196-
func removePublicSSHKeyComment(publicKey string) string {
197-
parts := strings.Split(publicKey, " ")
198-
if len(parts) == 3 {
199-
return strings.Join(parts[:2], " ")
200-
}
201-
return publicKey
202-
}

internal/services/instance/helpers_instance_block_test.go

-10
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ import (
1010
)
1111

1212
func TestUnknownVolume_VolumeTemplate(t *testing.T) {
13-
type fields struct {
14-
Zone scw.Zone
15-
ID string
16-
Name string
17-
Size *scw.Size
18-
ServerID *string
19-
Boot *bool
20-
IsBlockVolume bool
21-
InstanceVolumeType instanceSDK.VolumeVolumeType
22-
}
2313
tests := []struct {
2414
name string
2515
volume *instance.UnknownVolume

internal/services/tem/helpers.go

-18
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
package tem
22

33
import (
4-
"context"
54
"time"
65

76
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
87
tem "github.com/scaleway/scaleway-sdk-go/api/tem/v1alpha1"
98
"github.com/scaleway/scaleway-sdk-go/scw"
109
"github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional"
1110
"github.com/scaleway/terraform-provider-scaleway/v2/internal/meta"
12-
"github.com/scaleway/terraform-provider-scaleway/v2/internal/transport"
1311
)
1412

1513
const (
@@ -39,19 +37,3 @@ func NewAPIWithRegionAndID(m interface{}, id string) (*tem.API, scw.Region, stri
3937
}
4038
return api, region, id, nil
4139
}
42-
43-
func waitForTemDomain(ctx context.Context, api *tem.API, region scw.Region, id string, timeout time.Duration) (*tem.Domain, error) {
44-
retryInterval := defaultDomainRetryInterval
45-
if transport.DefaultWaitRetryInterval != nil {
46-
retryInterval = *transport.DefaultWaitRetryInterval
47-
}
48-
49-
domain, err := api.WaitForDomain(&tem.WaitForDomainRequest{
50-
Region: region,
51-
DomainID: id,
52-
RetryInterval: &retryInterval,
53-
Timeout: scw.TimeDurationPtr(timeout),
54-
}, scw.WithContext(ctx))
55-
56-
return domain, err
57-
}

0 commit comments

Comments
 (0)