Skip to content

Commit 1c9d339

Browse files
authored
chore: use uber gomock instead of golang/mock (#5075)
1 parent b7f601c commit 1c9d339

File tree

8 files changed

+62
-54
lines changed

8 files changed

+62
-54
lines changed

core/discov/internal/etcdclient_mock.go

Lines changed: 29 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/discov/internal/registry_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"testing"
88
"time"
99

10-
"github.com/golang/mock/gomock"
1110
"github.com/stretchr/testify/assert"
1211
"github.com/zeromicro/go-zero/core/contextx"
1312
"github.com/zeromicro/go-zero/core/lang"
@@ -18,6 +17,7 @@ import (
1817
"go.etcd.io/etcd/api/v3/mvccpb"
1918
clientv3 "go.etcd.io/etcd/client/v3"
2019
"go.etcd.io/etcd/client/v3/mock/mockserver"
20+
"go.uber.org/mock/gomock"
2121
)
2222

2323
var mockLock sync.Mutex

core/discov/internal/statewatcher_mock.go

Lines changed: 15 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/discov/internal/statewatcher_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"sync"
55
"testing"
66

7-
"github.com/golang/mock/gomock"
7+
"go.uber.org/mock/gomock"
88
"google.golang.org/grpc/connectivity"
99
)
1010

core/discov/internal/updatelistener_mock.go

Lines changed: 15 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/discov/publisher_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import (
99
"testing"
1010
"time"
1111

12-
"github.com/golang/mock/gomock"
1312
"github.com/stretchr/testify/assert"
1413
"github.com/zeromicro/go-zero/core/discov/internal"
1514
"github.com/zeromicro/go-zero/core/lang"
1615
"github.com/zeromicro/go-zero/core/logx"
1716
"github.com/zeromicro/go-zero/core/stringx"
1817
"go.etcd.io/etcd/api/v3/mvccpb"
1918
clientv3 "go.etcd.io/etcd/client/v3"
19+
"go.uber.org/mock/gomock"
2020
"golang.org/x/net/http2"
2121
"google.golang.org/grpc"
2222
"google.golang.org/grpc/credentials/insecure"

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ require (
99
github.com/fullstorydev/grpcurl v1.9.3
1010
github.com/go-sql-driver/mysql v1.9.0
1111
github.com/golang-jwt/jwt/v4 v4.5.2
12-
github.com/golang/mock v1.6.0
1312
github.com/golang/protobuf v1.5.4
1413
github.com/google/uuid v1.6.0
1514
github.com/grafana/pyroscope-go v1.2.4

0 commit comments

Comments
 (0)