瀏覽代碼

ci: remove uses of deprecated gotest.tools v2 (#9935)

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sebastiaan van Stijn 3 年之前
父節點
當前提交
34e945a598
共有 7 個文件被更改,包括 11 次插入7 次删除
  1. 7 0
      .golangci.yml
  2. 1 1
      cmd/formatter/formatter_test.go
  3. 0 1
      go.mod
  4. 0 2
      go.sum
  5. 1 1
      pkg/compose/convergence_test.go
  6. 1 1
      pkg/compose/dependencies_test.go
  7. 1 1
      pkg/compose/envresolver_test.go

+ 7 - 0
.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".

+ 1 - 1
cmd/formatter/formatter_test.go

@@ -22,7 +22,7 @@ import (
 	"io"
 	"testing"
 
-	"gotest.tools/assert"
+	"gotest.tools/v3/assert"
 )
 
 type testStruct struct {

+ 0 - 1
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
 )

+ 0 - 2
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=

+ 1 - 1
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"

+ 1 - 1
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{

+ 1 - 1
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) {