Skip to content

Commit

Permalink
fix gofumpt
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone committed Feb 8, 2024
1 parent 8b55193 commit 1ae3cb4
Show file tree
Hide file tree
Showing 67 changed files with 0 additions and 72 deletions.
4 changes: 0 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ linters:
- bodyclose # checks whether HTTP response body is closed successfully [fast: false, auto-fix: false]
- containedctx # containedctx is a linter that detects struct contained context.Context field [fast: true, auto-fix: false]
- contextcheck # check the function whether use a non-inherited context [fast: false, auto-fix: false]
- deadcode # Finds unused code [fast: false, auto-fix: false]
- decorder # check declaration order and count of types, constants, variables and functions [fast: true, auto-fix: false]
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false]
- dupword # checks for duplicate words in the source code [fast: true, auto-fix: true]
Expand Down Expand Up @@ -37,7 +36,6 @@ linters:
- gosimple #(megacheck): Linter for Go source code that specializes in simplifying a code [fast: false, auto-fix: false]
- govet #(vet, vetshadow): Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string [fast: false, auto-fix: false]
- grouper # An analyzer to analyze expression groups. [fast: true, auto-fix: false]
- ifshort # Checks that your code uses short syntax for if-statements whenever possible [fast: true, auto-fix: false]
- importas # Enforces consistent import aliases [fast: false, auto-fix: false]
- ineffassign # Detects when assignments to existing variables are not used [fast: true, auto-fix: false]
- ireturn # Accept Interfaces, Return Concrete Types [fast: false, auto-fix: false]
Expand All @@ -59,7 +57,6 @@ linters:
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. [fast: false, auto-fix: false]
- rowserrcheck # checks whether Err of rows is checked successfully [fast: false, auto-fix: false]
- sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed. [fast: false, auto-fix: false]
- structcheck # Finds unused struct fields [fast: false, auto-fix: false]
- stylecheck # Stylecheck is a replacement for golint [fast: false, auto-fix: false]
- tagliatelle # Checks the struct tags. [fast: true, auto-fix: false]
- tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 [fast: false, auto-fix: false]
Expand All @@ -68,7 +65,6 @@ 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]
- varcheck # Finds unused global variables and constants [fast: false, 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
1 change: 0 additions & 1 deletion scaleway/data_source_baremetal_option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func testAccCheckScalewayBaremetalOptionExists(tt *TestTools, n string) resource
OptionID: ID,
Zone: zone,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/data_source_baremetal_os_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ func testAccCheckScalewayBaremetalOsExists(tt *TestTools, n string) resource.Tes
OsID: ID,
Zone: zone,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/data_source_k8s_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ func testAccCheckScalewayK8SVersionExists(tt *TestTools, n string) resource.Test
Region: region,
VersionName: name,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/data_source_object_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func dataSourceScalewayObjectStorageRead(ctx context.Context, d *schema.Resource

log.Printf("[DEBUG] Reading Object Storage bucket: %s", input)
_, err = s3Client.HeadBucketWithContext(ctx, input)

if err != nil {
return diag.FromErr(fmt.Errorf("failed getting Object Storage bucket (%s): %w", bucket, err))
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/data_source_registry_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func testAccCheckScalewayRegistryImageExists(tt *TestTools, n string) resource.T
ImageID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_apple_silicon_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ func testAccCheckScalewayAppleSiliconExists(tt *TestTools, n string) resource.Te
ServerID: ID,
Zone: zone,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_block_snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ func testAccCheckScalewayBlockSnapshotExists(tt *TestTools, n string) resource.T
SnapshotID: id,
Zone: zone,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_block_volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ func testAccCheckScalewayBlockVolumeExists(tt *TestTools, n string) resource.Tes
VolumeID: id,
Zone: zone,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_container_cron_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ func testAccCheckScalewayContainerCronExists(tt *TestTools, n string) resource.T
CronID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_container_namespace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ func testAccCheckScalewayContainerNamespaceExists(tt *TestTools, n string) resou
NamespaceID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ func testAccCheckScalewayContainerExists(tt *TestTools, n string) resource.TestC
ContainerID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_container_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func testAccCheckScalewayContainerTokenExists(tt *TestTools, n string) resource.
TokenID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_container_trigger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ func testAccCheckScalewayContainerTriggerExists(tt *TestTools, n string) resourc
TriggerID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_document_db_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ func testAccCheckScalewayDocumentDBInstanceExists(tt *TestTools, n string) resou
InstanceID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
2 changes: 0 additions & 2 deletions scaleway/resource_document_db_private_network_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ func resourceScalewayDocumentDBInstanceEndpointUpdate(ctx context.Context, d *sc
}

_, err = waitForDocumentDBInstance(ctx, api, region, req.InstanceID, d.Timeout(schema.TimeoutCreate))

if err != nil {
return diag.FromErr(err)
}
Expand All @@ -203,7 +202,6 @@ func resourceScalewayDocumentDBInstanceEndpointDelete(ctx context.Context, d *sc
Region: region,
EndpointID: id,
}, scw.WithContext(ctx))

if err != nil {
return diag.FromErr(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ func testAccCheckScalewayDocumentDBInstanceEndpointExists(tt *TestTools, n strin
EndpointID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_domain_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,6 @@ func resourceScalewayDomainRecordDelete(ctx context.Context, d *schema.ResourceD
DNSZone: d.Get("dns_zone").(string),
ProjectID: d.Get("project_id").(string),
})

if err != nil {
if is404Error(err) || is403Error(err) {
return nil
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_domain_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ func resourceScalewayDomainZoneCreate(ctx context.Context, d *schema.ResourceDat
Domain: domainName,
Subdomain: subdomainName,
}, scw.WithContext(ctx))

if err != nil {
if is409Error(err) {
return resourceScalewayDomainZoneRead(ctx, d, meta)
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_flexible_ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ func testAccCheckScalewayFlexibleIPExists(tt *TestTools, name string) resource.T
FipID: ID,
Zone: zone,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_function_cron_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ func testAccCheckScalewayFunctionCronExists(tt *TestTools, n string) resource.Te
CronID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_function_domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ func testAccCheckScalewayFunctionDomainExists(tt *TestTools, n string) resource.
DomainID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_function_namespace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ func testAccCheckScalewayFunctionNamespaceExists(tt *TestTools, n string) resour
NamespaceID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ func testAccCheckScalewayFunctionExists(tt *TestTools, n string) resource.TestCh
FunctionID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_function_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func testAccCheckScalewayFunctionTokenExists(tt *TestTools, n string) resource.T
TokenID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_function_trigger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ func testAccCheckScalewayFunctionTriggerExists(tt *TestTools, n string) resource
TriggerID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_instance_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ func resourceScalewayInstanceIPDelete(ctx context.Context, d *schema.ResourceDat
IP: ID,
Zone: zone,
}, scw.WithContext(ctx))

if err != nil {
// We check for 403 because instance API returns 403 for a deleted IP
if is404Error(err) || is403Error(err) {
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_instance_ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ func testAccCheckScalewayInstanceIPExists(tt *TestTools, name string) resource.T
IP: ID,
Zone: zone,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_instance_placement_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ func testAccCheckScalewayInstancePlacementGroupExists(tt *TestTools, n string) r
Zone: zone,
PlacementGroupID: ID,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_instance_private_nic.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ func resourceScalewayInstancePrivateNICDelete(ctx context.Context, d *schema.Res
PrivateNicID: privateNICID,
Zone: zone,
}, scw.WithContext(ctx))

if err != nil {
if is404Error(err) {
return nil
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_instance_security_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,6 @@ func testAccCheckScalewayInstanceSecurityGroupExists(tt *TestTools, n string) re
SecurityGroupID: ID,
Zone: zone,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_instance_snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ func testAccCheckScalewayInstanceSnapShotExists(tt *TestTools, n string) resourc
Zone: zone,
SnapshotID: ID,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_instance_volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ func testAccCheckScalewayInstanceVolumeExists(tt *TestTools, n string) resource.
VolumeID: id,
Zone: zone,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_ipam_ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ func testAccCheckScalewayIPAMIPExists(tt *TestTools, n string) resource.TestChec
IPID: ID,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_job_definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ func testAccCheckScalewayJobDefinitionExists(tt *TestTools, n string) resource.T
JobDefinitionID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_lb_frontend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ func testAccCheckScalewayLbFrontendExists(tt *TestTools, n string) resource.Test
FrontendID: ID,
Zone: zone,
})

if err != nil {
return err
}
Expand Down
2 changes: 0 additions & 2 deletions scaleway/resource_lb_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ func resourceScalewayLbIPUpdate(ctx context.Context, d *schema.ResourceData, met
ip = res
return nil
})

if err != nil {
if is404Error(err) {
d.SetId("")
Expand Down Expand Up @@ -221,7 +220,6 @@ func resourceScalewayLbIPDelete(ctx context.Context, d *schema.ResourceData, met
ip = res
return nil
})

if err != nil {
return diag.FromErr(err)
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_lb_ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ func testAccCheckScalewayLbIPExists(tt *TestTools, n string) resource.TestCheckF
IPID: ID,
Zone: zone,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_lb_route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ func testAccCheckScalewayLbRouteExists(tt *TestTools, n string) resource.TestChe
RouteID: ID,
Zone: zone,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_lb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,6 @@ func testAccCheckScalewayLbExists(tt *TestTools, n string) resource.TestCheckFun
LBID: ID,
Zone: zone,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_mnq_nats_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ func testAccCheckScalewayMNQNatsAccountExists(tt *TestTools, n string) resource.
NatsAccountID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_mnq_nats_credentials_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func testAccCheckScalewayMNQNatsCredentialsExists(tt *TestTools, n string) resou
NatsCredentialsID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_mnq_sns_credentials_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ func testAccCheckScalewayMNQSNSCredentialsExists(tt *TestTools, n string) resour
SnsCredentialsID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_mnq_sqs_credentials_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ func testAccCheckScalewayMNQSQSCredentialsExists(tt *TestTools, n string) resour
SqsCredentialsID: id,
Region: region,
})

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion scaleway/resource_object_bucket_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ func resourceBucketACLUpdate(ctx context.Context, d *schema.ResourceData, meta i
}

_, err = conn.PutBucketAclWithContext(ctx, input)

if err != nil {
return diag.FromErr(fmt.Errorf("error updating object bucket ACL (%s): %w", d.Id(), err))
}
Expand Down
Loading

0 comments on commit 1ae3cb4

Please sign in to comment.