diff --git a/.golangci.yaml b/.golangci.yaml index 5333f86b47f943..f1e7f6f35163d6 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -14,6 +14,7 @@ linters: - gocritic - gofumpt - goimports + - gomodguard - gosimple - govet - ineffassign @@ -40,6 +41,13 @@ linters-settings: - typeSwitchVar goimports: local-prefixes: github.com/argoproj/argo-cd/v2 + gomodguard: + blocked: + modules: + - github.com/imdario/mergo: + recommendations: + - dario.cat/mergo + reason: "`github.com/imdario/mergo` has been renamed." perfsprint: # Optimizes even if it requires an int or uint type cast. int-conversion: true diff --git a/applicationset/generators/generator_spec_processor.go b/applicationset/generators/generator_spec_processor.go index 25e6b138da7491..195a7558b351ae 100644 --- a/applicationset/generators/generator_spec_processor.go +++ b/applicationset/generators/generator_spec_processor.go @@ -13,7 +13,7 @@ import ( argoprojiov1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" - "github.com/imdario/mergo" + "dario.cat/mergo" log "github.com/sirupsen/logrus" ) diff --git a/applicationset/generators/matrix.go b/applicationset/generators/matrix.go index 2a44d97b71ac5a..279df97557a8ca 100644 --- a/applicationset/generators/matrix.go +++ b/applicationset/generators/matrix.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/imdario/mergo" + "dario.cat/mergo" "sigs.k8s.io/controller-runtime/pkg/client" "github.com/argoproj/argo-cd/v2/applicationset/utils" diff --git a/applicationset/generators/merge.go b/applicationset/generators/merge.go index e9af81fadae4e5..bf57f6a330579b 100644 --- a/applicationset/generators/merge.go +++ b/applicationset/generators/merge.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/imdario/mergo" + "dario.cat/mergo" "sigs.k8s.io/controller-runtime/pkg/client" "github.com/argoproj/argo-cd/v2/applicationset/utils" diff --git a/controller/state_test.go b/controller/state_test.go index 2efc51718f9ef7..ad33de8e8c42d1 100644 --- a/controller/state_test.go +++ b/controller/state_test.go @@ -7,11 +7,11 @@ import ( "testing" "time" + "dario.cat/mergo" "github.com/argoproj/gitops-engine/pkg/health" synccommon "github.com/argoproj/gitops-engine/pkg/sync/common" "github.com/argoproj/gitops-engine/pkg/utils/kube" . "github.com/argoproj/gitops-engine/pkg/utils/testing" - "github.com/imdario/mergo" "github.com/sirupsen/logrus" logrustest "github.com/sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" diff --git a/go.mod b/go.mod index 10b440abf904be..0523269842f118 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.22.0 require ( code.gitea.io/sdk/gitea v0.19.0 + dario.cat/mergo v1.0.1 github.com/Azure/kubelogin v0.1.6 github.com/Masterminds/semver/v3 v3.3.1 github.com/Masterminds/sprig/v3 v3.3.0 @@ -54,7 +55,6 @@ require ( github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/hashicorp/go-retryablehttp v0.7.7 - github.com/imdario/mergo v0.3.16 github.com/improbable-eng/grpc-web v0.15.0 github.com/itchyny/gojq v0.12.17 github.com/jeremywohl/flatten v1.0.1 @@ -113,7 +113,6 @@ require ( ) require ( - dario.cat/mergo v1.0.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect @@ -142,6 +141,7 @@ require ( github.com/google/s2a-go v0.1.7 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.3 // indirect + github.com/imdario/mergo v0.3.16 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect