Skip to content

Commit f2d6b4f

Browse files
committed
fix golangci-lint
1 parent ab17c37 commit f2d6b4f

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

internal/services/object/object.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package object
33
import (
44
"bytes"
55
"context"
6-
"crypto/md5"
6+
"crypto/md5" // #nosec
77
"encoding/base64"
88
"encoding/hex"
99
"fmt"
@@ -173,10 +173,10 @@ func resourceObjectCreate(ctx context.Context, d *schema.ResourceData, m interfa
173173

174174
// Server-side encryption
175175
if customerKey := d.Get("sse_customer_key").(string); customerKey != "" {
176-
//TODO: encode the following fields to base64 before adding them to the request ?
176+
// TODO: encode the following fields to base64 before adding them to the request ?
177177
req.SSECustomerAlgorithm = scw.StringPtr("AES256")
178178
req.SSECustomerKey = &customerKey
179-
hash := md5.Sum([]byte(customerKey))
179+
hash := md5.Sum([]byte(customerKey)) // #nosec
180180
req.SSECustomerKeyMD5 = scw.StringPtr(hex.EncodeToString(hash[:]))
181181
}
182182

internal/services/object/object_test.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ import (
2020

2121
// Service information constants
2222
const (
23-
ServiceName = "scw" // Name of service.
24-
EndpointsID = ServiceName // ID to look up a service endpoint with.
23+
ServiceName = "scw" // Name of service.
24+
EndpointsID = ServiceName // ID to look up a service endpoint with.
25+
fileContentStep2 = "This is a different content"
26+
fileContentStep1 = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
2527
)
2628

2729
func TestAccObject_Basic(t *testing.T) {
@@ -556,9 +558,6 @@ func TestAccObject_ByContent(t *testing.T) {
556558
defer tt.Cleanup()
557559
bucketName := sdkacctest.RandomWithPrefix("test-acc-scaleway-object-by-content")
558560

559-
fileContentStep1 := "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
560-
fileContentStep2 := "This is a different content"
561-
562561
resource.ParallelTest(t, resource.TestCase{
563562
PreCheck: func() { acctest.PreCheck(t) },
564563
ProviderFactories: tt.ProviderFactories,
@@ -614,8 +613,6 @@ func TestAccObject_ByContentBase64(t *testing.T) {
614613
defer tt.Cleanup()
615614
bucketName := sdkacctest.RandomWithPrefix("test-acc-scaleway-object-by-content-base64")
616615

617-
fileContentStep1 := "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
618-
fileContentStep2 := "This is a different content"
619616
fileEncodedStep1 := base64.StdEncoding.EncodeToString([]byte(fileContentStep1))
620617
fileEncodedStep2 := base64.StdEncoding.EncodeToString([]byte(fileContentStep2))
621618

@@ -689,9 +686,6 @@ func TestAccObject_SSECustomer(t *testing.T) {
689686
defer tt.Cleanup()
690687
bucketName := sdkacctest.RandomWithPrefix("test-acc-scaleway-object-sse-customer")
691688

692-
fileContentStep1 := "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
693-
fileContentStep2 := "This is a different content"
694-
695689
resource.ParallelTest(t, resource.TestCase{
696690
PreCheck: func() { acctest.PreCheck(t) },
697691
ProviderFactories: tt.ProviderFactories,

0 commit comments

Comments
 (0)