Skip to content

Commit 5f24df2

Browse files
authored
chore: migrate to go1.24 (#2941)
* chore: migrate to go1.24 * Fix * Fix
1 parent 22e5662 commit 5f24df2

23 files changed

+63
-74
lines changed

.github/workflows/acceptance-tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Install Go
5353
uses: actions/setup-go@v5
5454
with:
55-
go-version: 1.23.5
55+
go-version: 1.24.0
5656
- name: Run Acceptance Tests
5757
run: go test -v ./internal/services/${{ matrix.products }} -timeout=2h
5858
env:
@@ -76,7 +76,7 @@ jobs:
7676
- name: Install Go
7777
uses: actions/setup-go@v5
7878
with:
79-
go-version: 1.23.5
79+
go-version: 1.24.0
8080
- name: Install Terraform
8181
uses: hashicorp/setup-terraform@v3
8282
- name: Run scwconfig tests

.github/workflows/documentation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- docs/**
1313

1414
env:
15-
GO_VERSION: "1.23.5"
15+
GO_VERSION: "1.24.0"
1616
GO111MODULE: on
1717

1818
jobs:

.github/workflows/nightly.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Install Go
5454
uses: actions/setup-go@v5
5555
with:
56-
go-version: 1.23.5
56+
go-version: 1.24.0
5757
- name: Run Acceptance Tests
5858
run: go test -v ./internal/services/${{ matrix.products }} -timeout=4h
5959
env:
@@ -105,7 +105,7 @@ jobs:
105105
- name: Install Go
106106
uses: actions/setup-go@v5
107107
with:
108-
go-version: 1.23.5
108+
go-version: 1.24.0
109109
- name: Install Terraform
110110
uses: hashicorp/setup-terraform@v3
111111
- name: Run sweepers

.github/workflows/purge.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Install Go
1313
uses: actions/setup-go@v5
1414
with:
15-
go-version: 1.23.5
15+
go-version: 1.24.0
1616
- name: Install Terraform
1717
uses: hashicorp/setup-terraform@v3
1818
- name: Run sweepers

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Set up Go
2929
uses: actions/setup-go@v5
3030
with:
31-
go-version: 1.23.5
31+
go-version: 1.24.0
3232

3333
- name: Import GPG key
3434
id: import_gpg

.github/workflows/tfproviderlint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: actions/setup-go@v5
1515
with:
16-
go-version: 1.23.5
16+
go-version: 1.24.0
1717
- name: Install tfproviderlint
1818
run: go install github.com/bflad/tfproviderlint/cmd/tfproviderlint
1919
- name: Run tfproviderlint
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@v4
2626
- uses: actions/setup-go@v5
2727
with:
28-
go-version: 1.23.5
28+
go-version: 1.24.0
2929
- uses: hashicorp/setup-terraform@v3
3030
- run: go install github.com/bflad/tfproviderdocs@latest
3131
- run: make tfproviderdocs

.github/workflows/unit-tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Install Go
1717
uses: actions/setup-go@v5
1818
with:
19-
go-version: 1.23.5
19+
go-version: 1.24.0
2020
- name: Install Terraform
2121
uses: hashicorp/setup-terraform@v3
2222
- name: Build binaries

GNUmakefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ website:
5656
.PHONY: build test testacc vet fmt fmtcheck errcheck test-compile website
5757

5858
tfproviderlint:
59-
go run github.com/bflad/tfproviderlint/cmd/tfproviderlint -R014=false -AT001.ignored-filename-suffixes=_data_source_test.go ./...
59+
go tool tfproviderlint -R014=false -AT001.ignored-filename-suffixes=_data_source_test.go ./...
6060

6161
tfproviderdocs:
62-
go run github.com/bflad/tfproviderdocs check -provider-name scaleway -enable-contents-check
62+
go tool tfproviderdocs check -provider-name scaleway -enable-contents-check

go.mod

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/scaleway/terraform-provider-scaleway/v2
22

3-
go 1.23.5
3+
go 1.24.0
44

55
require (
66
github.com/aws/aws-sdk-go-v2 v1.36.0
@@ -10,8 +10,6 @@ require (
1010
github.com/aws/aws-sdk-go-v2/service/sns v1.33.17
1111
github.com/aws/aws-sdk-go-v2/service/sqs v1.37.12
1212
github.com/aws/smithy-go v1.22.2
13-
github.com/bflad/tfproviderdocs v0.12.1
14-
github.com/bflad/tfproviderlint v0.30.0
1513
github.com/docker/docker v27.5.1+incompatible
1614
github.com/dustin/go-humanize v1.0.1
1715
github.com/google/go-cmp v0.6.0
@@ -30,7 +28,7 @@ require (
3028
github.com/robfig/cron/v3 v3.0.1
3129
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250206152403-1eed2f2ce9d3
3230
github.com/stretchr/testify v1.10.0
33-
golang.org/x/crypto v0.32.0
31+
golang.org/x/crypto v0.33.0
3432
gopkg.in/dnaeon/go-vcr.v3 v3.2.0
3533
)
3634

@@ -58,6 +56,8 @@ require (
5856
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.13 // indirect
5957
github.com/aws/aws-sdk-go-v2/service/sts v1.33.12 // indirect
6058
github.com/bflad/gopaniccheck v0.1.0 // indirect
59+
github.com/bflad/tfproviderdocs v0.12.1 // indirect
60+
github.com/bflad/tfproviderlint v0.31.0 // indirect
6161
github.com/bgentry/speakeasy v0.1.0 // indirect
6262
github.com/bmatcuk/doublestar v1.3.4 // indirect
6363
github.com/cloudflare/circl v1.3.7 // indirect
@@ -123,13 +123,13 @@ require (
123123
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 // indirect
124124
go.opentelemetry.io/otel/metric v1.31.0 // indirect
125125
go.opentelemetry.io/otel/trace v1.31.0 // indirect
126-
golang.org/x/mod v0.22.0 // indirect
127-
golang.org/x/net v0.34.0 // indirect
126+
golang.org/x/mod v0.23.0 // indirect
127+
golang.org/x/net v0.35.0 // indirect
128128
golang.org/x/sync v0.11.0 // indirect
129-
golang.org/x/sys v0.29.0 // indirect
129+
golang.org/x/sys v0.30.0 // indirect
130130
golang.org/x/text v0.22.0 // indirect
131131
golang.org/x/time v0.3.0 // indirect
132-
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
132+
golang.org/x/tools v0.30.0 // indirect
133133
google.golang.org/appengine v1.6.8 // indirect
134134
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
135135
google.golang.org/grpc v1.69.4 // indirect
@@ -138,3 +138,8 @@ require (
138138
gopkg.in/yaml.v3 v3.0.1 // indirect
139139
gotest.tools/v3 v3.0.3 // indirect
140140
)
141+
142+
tool (
143+
github.com/bflad/tfproviderdocs
144+
github.com/bflad/tfproviderlint/cmd/tfproviderlint
145+
)

go.sum

+14-14
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ github.com/bflad/gopaniccheck v0.1.0 h1:tJftp+bv42ouERmUMWLoUn/5bi/iQZjHPznM00cP
6969
github.com/bflad/gopaniccheck v0.1.0/go.mod h1:ZCj2vSr7EqVeDaqVsWN4n2MwdROx1YL+LFo47TSWtsA=
7070
github.com/bflad/tfproviderdocs v0.12.1 h1:MlHjrSa+pz1RxaCdvUWj+ZI5IwKMF7tjL4JTLg+dlTs=
7171
github.com/bflad/tfproviderdocs v0.12.1/go.mod h1:3zyWdyOoqheS0xjftKuFboq5k405mJrblp9leVIvvDo=
72-
github.com/bflad/tfproviderlint v0.30.0 h1:XBbTGPS4ZagSt4Qtnus3Vgh5yOeHNLZhnjcTcsSJ7ZM=
73-
github.com/bflad/tfproviderlint v0.30.0/go.mod h1:eBZHT0r7HKPGw1uZEyGMzcR1/d+GAXq9KzQfw0I7wtY=
72+
github.com/bflad/tfproviderlint v0.31.0 h1:9N/dUzFARsTpAQOjdZzIWnHKMzQc7UDDEYrSNV2xnrw=
73+
github.com/bflad/tfproviderlint v0.31.0/go.mod h1:yZQdJs4uobBIgVHt1Tv5OpHhgM8fwh29OgxL/La5BFs=
7474
github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY=
7575
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
7676
github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQrS0=
@@ -346,14 +346,14 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
346346
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
347347
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
348348
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
349-
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
350-
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
349+
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
350+
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
351351
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
352352
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
353353
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
354354
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
355-
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
356-
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
355+
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
356+
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
357357
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
358358
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
359359
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -363,8 +363,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
363363
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
364364
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
365365
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
366-
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
367-
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
366+
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
367+
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
368368
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
369369
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
370370
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -388,13 +388,13 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
388388
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
389389
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
390390
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
391-
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
392-
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
391+
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
392+
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
393393
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
394394
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
395395
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
396-
golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
397-
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
396+
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
397+
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
398398
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
399399
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
400400
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -412,8 +412,8 @@ golang.org/x/tools v0.0.0-20200214201135-548b770e2dfa/go.mod h1:TB2adYChydJhpapK
412412
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
413413
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
414414
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
415-
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
416-
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
415+
golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY=
416+
golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY=
417417
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
418418
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
419419
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

internal/acctest/acctest.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package acctest
22

33
import (
4-
"context"
54
"os"
65
"strconv"
76
"strings"
@@ -27,7 +26,7 @@ type TestTools struct {
2726
func NewTestTools(t *testing.T) *TestTools {
2827
t.Helper()
2928

30-
ctx := context.Background()
29+
ctx := t.Context()
3130

3231
folder, err := os.Getwd()
3332
if err != nil {

internal/provider/provider_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package provider_test
22

33
import (
4-
"context"
54
"fmt"
65
"testing"
76

@@ -20,7 +19,7 @@ func TestAccProvider_InstanceIPZones(t *testing.T) {
2019
tt := acctest.NewTestTools(t)
2120
defer tt.Cleanup()
2221

23-
ctx := context.Background()
22+
ctx := t.Context()
2423

2524
resource.ParallelTest(t, resource.TestCase{
2625
PreCheck: func() { acctest.PreCheck(t) },
@@ -78,7 +77,7 @@ func TestAccProvider_SSHKeys(t *testing.T) {
7877
SSHKeyName := "TestAccScalewayProvider_SSHKeys"
7978
SSHKey := "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEEYrzDOZmhItdKaDAEqJQ4ORS2GyBMtBozYsK5kiXXX [email protected]"
8079

81-
ctx := context.Background()
80+
ctx := t.Context()
8281

8382
resource.ParallelTest(t, resource.TestCase{
8483
PreCheck: func() { acctest.PreCheck(t) },

internal/services/iam/policy_test.go

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package iam_test
22

33
import (
4-
"context"
54
"fmt"
65
"testing"
76

@@ -18,7 +17,7 @@ func TestAccPolicy_Basic(t *testing.T) {
1817
tt := acctest.NewTestTools(t)
1918
defer tt.Cleanup()
2019

21-
ctx := context.Background()
20+
ctx := t.Context()
2221
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeIAMManager(tt)
2322
require.NoError(t, err)
2423

@@ -92,7 +91,7 @@ func TestAccPolicy_NoUpdate(t *testing.T) {
9291
tt := acctest.NewTestTools(t)
9392
defer tt.Cleanup()
9493

95-
ctx := context.Background()
94+
ctx := t.Context()
9695
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeIAMManager(tt)
9796
require.NoError(t, err)
9897

@@ -155,7 +154,7 @@ func TestAccPolicy_ChangeLinkedEntity(t *testing.T) {
155154
tt := acctest.NewTestTools(t)
156155
defer tt.Cleanup()
157156

158-
ctx := context.Background()
157+
ctx := t.Context()
159158
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeIAMManager(tt)
160159
require.NoError(t, err)
161160

@@ -261,7 +260,7 @@ func TestAccPolicy_ChangePermissions(t *testing.T) {
261260
tt := acctest.NewTestTools(t)
262261
defer tt.Cleanup()
263262

264-
ctx := context.Background()
263+
ctx := t.Context()
265264
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeIAMManager(tt)
266265
require.NoError(t, err)
267266

@@ -352,7 +351,7 @@ func TestAccPolicy_ProjectID(t *testing.T) {
352351
tt := acctest.NewTestTools(t)
353352
defer tt.Cleanup()
354353

355-
ctx := context.Background()
354+
ctx := t.Context()
356355
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeIAMManager(tt)
357356
require.NoError(t, err)
358357

@@ -418,7 +417,7 @@ func TestAccPolicy_Condition(t *testing.T) {
418417
tt := acctest.NewTestTools(t)
419418
defer tt.Cleanup()
420419

421-
ctx := context.Background()
420+
ctx := t.Context()
422421
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeIAMManager(tt)
423422
require.NoError(t, err)
424423

@@ -513,7 +512,7 @@ func TestAccPolicy_ChangeRulePrincipal(t *testing.T) {
513512
tt := acctest.NewTestTools(t)
514513
defer tt.Cleanup()
515514

516-
ctx := context.Background()
515+
ctx := t.Context()
517516
project, iamAPIKey, terminateFakeSideProject, err := acctest.CreateFakeIAMManager(tt)
518517
require.NoError(t, err)
519518

internal/services/lb/lb_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package lb_test
22

33
import (
4-
"context"
54
"errors"
65
"fmt"
76
"reflect"
@@ -692,7 +691,7 @@ func TestLbUpgradeV1SchemaUpgradeFunc(t *testing.T) {
692691
"id": "fr-par-1/22c61530-834c-4ab4-aa71-aaaa2ac9d45a",
693692
}
694693

695-
actual, err := lb.UpgradeStateV1Func(context.Background(), v0Schema, nil)
694+
actual, err := lb.UpgradeStateV1Func(t.Context(), v0Schema, nil)
696695
if err != nil {
697696
t.Fatalf("error migrating state: %s", err)
698697
}

internal/services/mnq/sns_topic_subscription_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestAccSNSTopicSubscription_Basic(t *testing.T) {
1919
tt := acctest.NewTestTools(t)
2020
defer tt.Cleanup()
2121

22-
ctx := context.Background()
22+
ctx := t.Context()
2323
resource.ParallelTest(t, resource.TestCase{
2424
PreCheck: func() { acctest.PreCheck(t) },
2525
ProviderFactories: tt.ProviderFactories,

internal/services/mnq/sns_topic_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func TestAccSNSTopic_Basic(t *testing.T) {
2020
tt := acctest.NewTestTools(t)
2121
defer tt.Cleanup()
2222

23-
ctx := context.Background()
23+
ctx := t.Context()
2424

2525
resource.ParallelTest(t, resource.TestCase{
2626
PreCheck: func() { acctest.PreCheck(t) },

internal/services/mnq/sqs_queue_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func TestAccSQSQueue_Basic(t *testing.T) {
2525
tt := acctest.NewTestTools(t)
2626
defer tt.Cleanup()
2727

28-
ctx := context.Background()
28+
ctx := t.Context()
2929

3030
resource.ParallelTest(t, resource.TestCase{
3131
PreCheck: func() { acctest.PreCheck(t) },
@@ -104,7 +104,7 @@ func TestAccSQSQueue_DefaultProject(t *testing.T) {
104104
tt := acctest.NewTestTools(t)
105105
defer tt.Cleanup()
106106

107-
ctx := context.Background()
107+
ctx := t.Context()
108108

109109
accountAPI := accountSDK.NewProjectAPI(tt.Meta.ScwClient())
110110
projectID := ""

0 commit comments

Comments
 (0)