From 34e945a598f6b0ba633215a755276d9ade6b437e Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 7 Nov 2022 20:07:41 +0100 Subject: [PATCH] ci: remove uses of deprecated gotest.tools v2 (#9935) Signed-off-by: Sebastiaan van Stijn --- .golangci.yml | 7 +++++++ cmd/formatter/formatter_test.go | 2 +- go.mod | 1 - go.sum | 2 -- pkg/compose/convergence_test.go | 2 +- pkg/compose/dependencies_test.go | 2 +- pkg/compose/envresolver_test.go | 2 +- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index df2fad4c6..fd374c8b2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,6 +11,7 @@ linters: - gocyclo - gofmt - goimports + - gomodguard - revive - gosimple - govet @@ -36,6 +37,12 @@ linters-settings: # The io/ioutil package has been deprecated. # https://go.dev/doc/go1.16#ioutil - io/ioutil + gomodguard: + blocked: + versions: + - gotest.tools: + version: "< 3.0.0" + reason: "deprecated, pre-modules version" gocritic: # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks. # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags". diff --git a/cmd/formatter/formatter_test.go b/cmd/formatter/formatter_test.go index be7f0bd2c..052226e65 100644 --- a/cmd/formatter/formatter_test.go +++ b/cmd/formatter/formatter_test.go @@ -22,7 +22,7 @@ import ( "io" "testing" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) type testStruct struct { diff --git a/go.mod b/go.mod index 02dd0f07a..32fd8e4ba 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,6 @@ require ( go.opentelemetry.io/otel v1.11.1 golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde gopkg.in/yaml.v2 v2.4.0 - gotest.tools v2.2.0+incompatible gotest.tools/v3 v3.4.0 k8s.io/client-go v0.24.1 // replaced; see replace for the actual version used ) diff --git a/go.sum b/go.sum index 3fef7b1c6..1ace8e4ff 100644 --- a/go.sum +++ b/go.sum @@ -1034,8 +1034,6 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= diff --git a/pkg/compose/convergence_test.go b/pkg/compose/convergence_test.go index a27f59589..3fc8092f1 100644 --- a/pkg/compose/convergence_test.go +++ b/pkg/compose/convergence_test.go @@ -26,7 +26,7 @@ import ( moby "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/golang/mock/gomock" - "gotest.tools/assert" + "gotest.tools/v3/assert" "github.com/docker/compose/v2/pkg/api" "github.com/docker/compose/v2/pkg/mocks" diff --git a/pkg/compose/dependencies_test.go b/pkg/compose/dependencies_test.go index 56b2a0433..9a958820a 100644 --- a/pkg/compose/dependencies_test.go +++ b/pkg/compose/dependencies_test.go @@ -24,7 +24,7 @@ import ( "github.com/compose-spec/compose-go/types" testify "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) var project = types.Project{ diff --git a/pkg/compose/envresolver_test.go b/pkg/compose/envresolver_test.go index 791bd5fbb..fca5f7191 100644 --- a/pkg/compose/envresolver_test.go +++ b/pkg/compose/envresolver_test.go @@ -19,7 +19,7 @@ package compose import ( "testing" - "gotest.tools/assert" + "gotest.tools/v3/assert" ) func Test_EnvResolverWithCase(t *testing.T) {