From aef181c45e16cff11036e3a7ef5f3f2feb15f552 Mon Sep 17 00:00:00 2001 From: Joel Rebello Date: Tue, 14 Nov 2023 14:51:29 +0100 Subject: [PATCH] gomock: move to go.uber.org/mock since https://github.com/golang/mock is deprecated --- go.mod | 2 +- go.sum | 3 ++- internal/outofband/action_handlers_test.go | 2 +- internal/outofband/actions_test.go | 2 +- internal/worker/task_handler_test.go | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 546b2239..679aae2f 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,6 @@ require ( github.com/emicklei/dot v1.6.0 github.com/equinix-labs/otel-init-go v0.0.9 github.com/filanov/stateswitch v1.0.1-0.20221115122927-775ae5822fad - github.com/golang/mock v1.6.0 github.com/google/uuid v1.3.1 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-retryablehttp v0.7.4 @@ -35,6 +34,7 @@ require ( go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 go.opentelemetry.io/otel v1.19.0 go.opentelemetry.io/otel/trace v1.19.0 + go.uber.org/mock v0.3.0 golang.org/x/net v0.17.0 golang.org/x/oauth2 v0.13.0 ) diff --git a/go.sum b/go.sum index 1fc97dfd..b1122813 100644 --- a/go.sum +++ b/go.sum @@ -264,7 +264,6 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -782,6 +781,8 @@ go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= +go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= diff --git a/internal/outofband/action_handlers_test.go b/internal/outofband/action_handlers_test.go index 1bacad55..0e5ca657 100644 --- a/internal/outofband/action_handlers_test.go +++ b/internal/outofband/action_handlers_test.go @@ -7,7 +7,6 @@ import ( "github.com/bmc-toolbox/common" sw "github.com/filanov/stateswitch" - "github.com/golang/mock/gomock" "github.com/metal-toolbox/flasher/internal/fixtures" "github.com/metal-toolbox/flasher/internal/model" sm "github.com/metal-toolbox/flasher/internal/statemachine" @@ -15,6 +14,7 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" ) type fakeStateSwitch struct{} diff --git a/internal/outofband/actions_test.go b/internal/outofband/actions_test.go index 453554b6..2ea792e6 100644 --- a/internal/outofband/actions_test.go +++ b/internal/outofband/actions_test.go @@ -12,13 +12,13 @@ import ( bconsts "github.com/bmc-toolbox/bmclib/v2/constants" sw "github.com/filanov/stateswitch" - "github.com/golang/mock/gomock" "github.com/metal-toolbox/flasher/internal/fixtures" "github.com/metal-toolbox/flasher/internal/model" sm "github.com/metal-toolbox/flasher/internal/statemachine" "github.com/metal-toolbox/flasher/internal/store" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" ) func newTaskFixture(status string) *model.Task { diff --git a/internal/worker/task_handler_test.go b/internal/worker/task_handler_test.go index 023df268..59b31a1d 100644 --- a/internal/worker/task_handler_test.go +++ b/internal/worker/task_handler_test.go @@ -3,7 +3,6 @@ package worker import ( "testing" - "github.com/golang/mock/gomock" "github.com/google/uuid" "github.com/metal-toolbox/flasher/internal/fixtures" "github.com/metal-toolbox/flasher/internal/model" @@ -12,6 +11,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.hollow.sh/toolbox/events/registry" + "go.uber.org/mock/gomock" bconsts "github.com/bmc-toolbox/bmclib/v2/constants" rctypes "github.com/metal-toolbox/rivets/condition"