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

chore: add support for unused #2716

Merged
merged 1 commit into from
Aug 23, 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 .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ linters:
- tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes [fast: false, auto-fix: false]
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code [fast: false, auto-fix: false]
- unconvert # Remove unnecessary type conversions [fast: false, auto-fix: false]
- unused #(megacheck): Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false]
- usestdlibvars # A linter that detect the possibility to use variables/constants from the Go standard library. [fast: true, auto-fix: false]
- wastedassign # wastedassign finds wasted assignment statements. [fast: false, auto-fix: false]
- whitespace # Tool for detection of leading and trailing whitespace [fast: true, auto-fix: true]
Expand Down Expand Up @@ -94,7 +95,6 @@ linters:
- nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value. [fast: false, auto-fix: false]
- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity [fast: true, auto-fix: false]
- staticcheck #(megacheck): Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: false, auto-fix: false]
- unused #(megacheck): Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false]
- varnamelen # checks that the length of a variable's name matches its scope [fast: false, auto-fix: false]
- wsl # Whitespace Linter - Forces you to use empty lines! [fast: true, auto-fix: false]

Expand Down
8 changes: 0 additions & 8 deletions internal/services/iam/ssh_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,3 @@ func resourceIamSSKKeyDelete(ctx context.Context, d *schema.ResourceData, m inte

return nil
}

func removePublicSSHKeyComment(publicKey string) string {
parts := strings.Split(publicKey, " ")
if len(parts) == 3 {
return strings.Join(parts[:2], " ")
}
return publicKey
}
10 changes: 0 additions & 10 deletions internal/services/instance/helpers_instance_block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ import (
)

func TestUnknownVolume_VolumeTemplate(t *testing.T) {
type fields struct {
Zone scw.Zone
ID string
Name string
Size *scw.Size
ServerID *string
Boot *bool
IsBlockVolume bool
InstanceVolumeType instanceSDK.VolumeVolumeType
}
tests := []struct {
name string
volume *instance.UnknownVolume
Expand Down
18 changes: 0 additions & 18 deletions internal/services/tem/helpers.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package tem

import (
"context"
"time"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
tem "github.com/scaleway/scaleway-sdk-go/api/tem/v1alpha1"
"github.com/scaleway/scaleway-sdk-go/scw"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/meta"
"github.com/scaleway/terraform-provider-scaleway/v2/internal/transport"
)

const (
Expand Down Expand Up @@ -39,19 +37,3 @@ func NewAPIWithRegionAndID(m interface{}, id string) (*tem.API, scw.Region, stri
}
return api, region, id, nil
}

func waitForTemDomain(ctx context.Context, api *tem.API, region scw.Region, id string, timeout time.Duration) (*tem.Domain, error) {
retryInterval := defaultDomainRetryInterval
if transport.DefaultWaitRetryInterval != nil {
retryInterval = *transport.DefaultWaitRetryInterval
}

domain, err := api.WaitForDomain(&tem.WaitForDomainRequest{
Region: region,
DomainID: id,
RetryInterval: &retryInterval,
Timeout: scw.TimeDurationPtr(timeout),
}, scw.WithContext(ctx))

return domain, err
}
Loading