This is an automated email from the ASF dual-hosted git repository.
Alanxtl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/develop by this push:
new d4b4fbfbc refactor: replace golang mock with uber mock (#3699)
d4b4fbfbc is described below
commit d4b4fbfbcab0e30b9285ceb5d8a73281970a0fa4
Author: xiaobaicai66695 <[email protected]>
AuthorDate: Wed Sep 2 15:07:37 2026 +0800
refactor: replace golang mock with uber mock (#3699)
* refactor: replace golang mock with uber mock
* test: remove redundant scaffold mock check
* build: remove redundant mock generation target
* ci: retrigger checks
---
.github/mockgen-copyright.txt | 14 +++++
cluster/cluster/available/cluster_invoker_test.go | 4 +-
cluster/cluster/broadcast/cluster_invoker_test.go | 4 +-
cluster/cluster/failback/cluster_test.go | 4 +-
cluster/cluster/failfast/cluster_test.go | 4 +-
cluster/cluster/failover/cluster_invoker_test.go | 4 +-
cluster/cluster/failsafe/cluster_test.go | 4 +-
cluster/cluster/forking/cluster_test.go | 4 +-
cluster/cluster/zoneaware/cluster_invoker_test.go | 4 +-
cluster/loadbalance/p2c/loadbalance_test.go | 4 +-
cluster/metrics/metrics.go | 1 +
cluster/metrics/mock_metrics.go | 46 ++++++++---------
config_center/nacos/impl_test.go | 4 +-
filter/accesslog/filter_test.go | 4 +-
filter/active/filter_test.go | 4 +-
filter/adaptivesvc/filter_test.go | 4 +-
filter/auth/consumer_sign_filter_test.go | 4 +-
filter/auth/provider_auth_filter_test.go | 4 +-
filter/generic/filter_test.go | 4 +-
filter/generic/service_filter_test.go | 4 +-
filter/generic/util_test.go | 4 +-
filter/handler/rejected_execution_handler_mock.go | 60 +++++++++++-----------
filter/otel/trace/filter_test.go | 4 +-
filter/rejected_execution_handler.go | 2 +
filter/tps/filter_test.go | 4 +-
filter/tps/limiter/method_service_test.go | 4 +-
filter/tps/limiter/mock.go | 58 ++++++++++-----------
filter/tps/strategy/mock.go | 55 ++++++++++----------
filter/tps_limiter.go | 1 +
filter/tps_strategy.go | 2 +
go.mod | 3 +-
go.sum | 4 +-
metadata/report/nacos/report_test.go | 4 +-
protocol/base/base_invoker.go | 2 +-
protocol/mock/mock_invoker.go | 50 +++++++++---------
registry/directory/directory_test.go | 4 +-
registry/nacos/registry_test.go | 4 +-
.../cmd/testGenCode/template/newApp/go.sum | 10 ----
.../cmd/testGenCode/template/newDemo/go.sum | 10 ----
.../generator/internal/scaffold/gosum.go | 10 ----
40 files changed, 209 insertions(+), 215 deletions(-)
diff --git a/.github/mockgen-copyright.txt b/.github/mockgen-copyright.txt
new file mode 100644
index 000000000..1745cfe66
--- /dev/null
+++ b/.github/mockgen-copyright.txt
@@ -0,0 +1,14 @@
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/cluster/cluster/available/cluster_invoker_test.go
b/cluster/cluster/available/cluster_invoker_test.go
index efcc17faa..a26c277fd 100644
--- a/cluster/cluster/available/cluster_invoker_test.go
+++ b/cluster/cluster/available/cluster_invoker_test.go
@@ -25,10 +25,10 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/cluster/cluster/broadcast/cluster_invoker_test.go
b/cluster/cluster/broadcast/cluster_invoker_test.go
index b200fc8ce..d98b8f17f 100644
--- a/cluster/cluster/broadcast/cluster_invoker_test.go
+++ b/cluster/cluster/broadcast/cluster_invoker_test.go
@@ -25,9 +25,9 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/cluster/cluster/failback/cluster_test.go
b/cluster/cluster/failback/cluster_test.go
index 98ddc292a..975a4cbb2 100644
--- a/cluster/cluster/failback/cluster_test.go
+++ b/cluster/cluster/failback/cluster_test.go
@@ -28,10 +28,10 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/cluster/cluster/failfast/cluster_test.go
b/cluster/cluster/failfast/cluster_test.go
index 1240f2d7b..2c40c29dc 100644
--- a/cluster/cluster/failfast/cluster_test.go
+++ b/cluster/cluster/failfast/cluster_test.go
@@ -25,10 +25,10 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/cluster/cluster/failover/cluster_invoker_test.go
b/cluster/cluster/failover/cluster_invoker_test.go
index 1c497848f..1f06338ae 100644
--- a/cluster/cluster/failover/cluster_invoker_test.go
+++ b/cluster/cluster/failover/cluster_invoker_test.go
@@ -25,9 +25,9 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/cluster/cluster/failsafe/cluster_test.go
b/cluster/cluster/failsafe/cluster_test.go
index 18957e88e..e84d46d71 100644
--- a/cluster/cluster/failsafe/cluster_test.go
+++ b/cluster/cluster/failsafe/cluster_test.go
@@ -25,10 +25,10 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/cluster/cluster/forking/cluster_test.go
b/cluster/cluster/forking/cluster_test.go
index 6fc5eb858..bf0934d56 100644
--- a/cluster/cluster/forking/cluster_test.go
+++ b/cluster/cluster/forking/cluster_test.go
@@ -27,10 +27,10 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/cluster/cluster/zoneaware/cluster_invoker_test.go
b/cluster/cluster/zoneaware/cluster_invoker_test.go
index 07e443376..dea778521 100644
--- a/cluster/cluster/zoneaware/cluster_invoker_test.go
+++ b/cluster/cluster/zoneaware/cluster_invoker_test.go
@@ -24,10 +24,10 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/cluster/loadbalance/p2c/loadbalance_test.go
b/cluster/loadbalance/p2c/loadbalance_test.go
index 5d39b17dd..f56974472 100644
--- a/cluster/loadbalance/p2c/loadbalance_test.go
+++ b/cluster/loadbalance/p2c/loadbalance_test.go
@@ -22,9 +22,9 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/cluster/metrics/metrics.go b/cluster/metrics/metrics.go
index 55026e4c8..772ce2dee 100644
--- a/cluster/metrics/metrics.go
+++ b/cluster/metrics/metrics.go
@@ -29,6 +29,7 @@ var (
ErrMetricsNotFound = errors.New("metrics not found")
)
+//go:generate go run go.uber.org/mock/[email protected] -copyright_file
../../.github/mockgen-copyright.txt -source metrics.go -destination
mock_metrics.go -package metrics
type Metrics interface {
// GetMethodMetrics returns method-level metrics, the format of key is
"{instance key}.{invoker key}.{method key}.{key}"
// url is invoker's url, which contains information about instance and
invoker.
diff --git a/cluster/metrics/mock_metrics.go b/cluster/metrics/mock_metrics.go
index 5359ae2be..ca50a98e2 100644
--- a/cluster/metrics/mock_metrics.go
+++ b/cluster/metrics/mock_metrics.go
@@ -1,42 +1,42 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
// Code generated by MockGen. DO NOT EDIT.
// Source: metrics.go
+//
+// Generated by this command:
+//
+// mockgen -copyright_file ../../.github/mockgen-copyright.txt -source
metrics.go -destination mock_metrics.go -package metrics
+//
-// Package mock_metrics is a generated GoMock package.
+// Package metrics is a generated GoMock package.
package metrics
import (
reflect "reflect"
-)
-import (
- gomock "github.com/golang/mock/gomock"
-)
-
-import (
common "dubbo.apache.org/dubbo-go/v3/common"
+ gomock "go.uber.org/mock/gomock"
)
// MockMetrics is a mock of Metrics interface.
type MockMetrics struct {
ctrl *gomock.Controller
recorder *MockMetricsMockRecorder
+ isgomock struct{}
}
// MockMetricsMockRecorder is the mock recorder for MockMetrics.
diff --git a/config_center/nacos/impl_test.go b/config_center/nacos/impl_test.go
index b3ae1d406..e5b6223ff 100644
--- a/config_center/nacos/impl_test.go
+++ b/config_center/nacos/impl_test.go
@@ -26,10 +26,10 @@ import (
gxset "github.com/dubbogo/gost/container/set"
nacosClient "github.com/dubbogo/gost/database/kv/nacos"
- "github.com/golang/mock/gomock"
-
"github.com/nacos-group/nacos-sdk-go/v2/model"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/filter/accesslog/filter_test.go b/filter/accesslog/filter_test.go
index 6e38a04dd..a9b459f1f 100644
--- a/filter/accesslog/filter_test.go
+++ b/filter/accesslog/filter_test.go
@@ -23,10 +23,10 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/filter/active/filter_test.go b/filter/active/filter_test.go
index b0a34b804..0dabbba45 100644
--- a/filter/active/filter_test.go
+++ b/filter/active/filter_test.go
@@ -26,10 +26,10 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/filter/adaptivesvc/filter_test.go
b/filter/adaptivesvc/filter_test.go
index 29eb2d8a5..dc7e43739 100644
--- a/filter/adaptivesvc/filter_test.go
+++ b/filter/adaptivesvc/filter_test.go
@@ -23,10 +23,10 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/filter/auth/consumer_sign_filter_test.go
b/filter/auth/consumer_sign_filter_test.go
index 1854cdced..8d0503a6a 100644
--- a/filter/auth/consumer_sign_filter_test.go
+++ b/filter/auth/consumer_sign_filter_test.go
@@ -23,9 +23,9 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/filter/auth/provider_auth_filter_test.go
b/filter/auth/provider_auth_filter_test.go
index 0465c06fe..07b7d0d30 100644
--- a/filter/auth/provider_auth_filter_test.go
+++ b/filter/auth/provider_auth_filter_test.go
@@ -25,9 +25,9 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/filter/generic/filter_test.go b/filter/generic/filter_test.go
index 081f15571..68c092b45 100644
--- a/filter/generic/filter_test.go
+++ b/filter/generic/filter_test.go
@@ -26,11 +26,11 @@ import (
import (
hessian "github.com/apache/dubbo-go-hessian2"
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+ "go.uber.org/mock/gomock"
+
"google.golang.org/protobuf/types/known/structpb"
)
diff --git a/filter/generic/service_filter_test.go
b/filter/generic/service_filter_test.go
index 6b2ec6063..afc4167d1 100644
--- a/filter/generic/service_filter_test.go
+++ b/filter/generic/service_filter_test.go
@@ -27,10 +27,10 @@ import (
import (
hessian "github.com/apache/dubbo-go-hessian2"
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/filter/generic/util_test.go b/filter/generic/util_test.go
index 8618cfe72..7a01e1a49 100644
--- a/filter/generic/util_test.go
+++ b/filter/generic/util_test.go
@@ -22,10 +22,10 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/filter/handler/rejected_execution_handler_mock.go
b/filter/handler/rejected_execution_handler_mock.go
index 8592d9d40..adfe487b8 100644
--- a/filter/handler/rejected_execution_handler_mock.go
+++ b/filter/handler/rejected_execution_handler_mock.go
@@ -1,64 +1,64 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
// Code generated by MockGen. DO NOT EDIT.
// Source: rejected_execution_handler.go
+//
+// Generated by this command:
+//
+// mockgen -copyright_file ../.github/mockgen-copyright.txt -source
rejected_execution_handler.go -destination
handler/rejected_execution_handler_mock.go -package handler
+//
-// Package filter is a generated GoMock package.
+// Package handler is a generated GoMock package.
package handler
import (
reflect "reflect"
-)
-import (
- gomock "github.com/golang/mock/gomock"
-)
-
-import (
common "dubbo.apache.org/dubbo-go/v3/common"
base "dubbo.apache.org/dubbo-go/v3/protocol/base"
- "dubbo.apache.org/dubbo-go/v3/protocol/result"
+ result "dubbo.apache.org/dubbo-go/v3/protocol/result"
+ gomock "go.uber.org/mock/gomock"
)
-// MockRejectedExecutionHandler is a mock of RejectedExecutionHandler interface
+// MockRejectedExecutionHandler is a mock of RejectedExecutionHandler
interface.
type MockRejectedExecutionHandler struct {
ctrl *gomock.Controller
recorder *MockRejectedExecutionHandlerMockRecorder
+ isgomock struct{}
}
-// MockRejectedExecutionHandlerMockRecorder is the mock recorder for
MockRejectedExecutionHandler
+// MockRejectedExecutionHandlerMockRecorder is the mock recorder for
MockRejectedExecutionHandler.
type MockRejectedExecutionHandlerMockRecorder struct {
mock *MockRejectedExecutionHandler
}
-// NewMockRejectedExecutionHandler creates a new mock instance
+// NewMockRejectedExecutionHandler creates a new mock instance.
func NewMockRejectedExecutionHandler(ctrl *gomock.Controller)
*MockRejectedExecutionHandler {
mock := &MockRejectedExecutionHandler{ctrl: ctrl}
mock.recorder = &MockRejectedExecutionHandlerMockRecorder{mock}
return mock
}
-// EXPECT returns an object that allows the caller to indicate expected use
+// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockRejectedExecutionHandler) EXPECT()
*MockRejectedExecutionHandlerMockRecorder {
return m.recorder
}
-// RejectedExecution mocks base method
+// RejectedExecution mocks base method.
func (m *MockRejectedExecutionHandler) RejectedExecution(url *common.URL,
invocation base.Invocation) result.Result {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RejectedExecution", url, invocation)
@@ -66,7 +66,7 @@ func (m *MockRejectedExecutionHandler) RejectedExecution(url
*common.URL, invoca
return ret0
}
-// RejectedExecution indicates an expected call of RejectedExecution
+// RejectedExecution indicates an expected call of RejectedExecution.
func (mr *MockRejectedExecutionHandlerMockRecorder) RejectedExecution(url,
invocation any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock,
"RejectedExecution",
reflect.TypeOf((*MockRejectedExecutionHandler)(nil).RejectedExecution), url,
invocation)
diff --git a/filter/otel/trace/filter_test.go b/filter/otel/trace/filter_test.go
index c9066960e..d21611525 100644
--- a/filter/otel/trace/filter_test.go
+++ b/filter/otel/trace/filter_test.go
@@ -24,11 +24,11 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/trace"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/filter/rejected_execution_handler.go
b/filter/rejected_execution_handler.go
index 424784722..476b9eecd 100644
--- a/filter/rejected_execution_handler.go
+++ b/filter/rejected_execution_handler.go
@@ -30,6 +30,8 @@ import (
// In such situation, implement this interface and register it by invoking
extension.SetRejectedExecutionHandler.
//
// RejectedExecution method will be called if the invocation was rejected by
some component.
+//
+//go:generate go run go.uber.org/mock/[email protected] -copyright_file
../.github/mockgen-copyright.txt -source rejected_execution_handler.go
-destination handler/rejected_execution_handler_mock.go -package handler
type RejectedExecutionHandler interface {
RejectedExecution(url *common.URL, invocation base.Invocation)
result.Result
}
diff --git a/filter/tps/filter_test.go b/filter/tps/filter_test.go
index b80aec4ce..dca9ed055 100644
--- a/filter/tps/filter_test.go
+++ b/filter/tps/filter_test.go
@@ -24,10 +24,10 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/filter/tps/limiter/method_service_test.go
b/filter/tps/limiter/method_service_test.go
index f376e3e53..60692ed06 100644
--- a/filter/tps/limiter/method_service_test.go
+++ b/filter/tps/limiter/method_service_test.go
@@ -23,9 +23,9 @@ import (
)
import (
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/filter/tps/limiter/mock.go b/filter/tps/limiter/mock.go
index 74b698fdd..8f2faa434 100644
--- a/filter/tps/limiter/mock.go
+++ b/filter/tps/limiter/mock.go
@@ -1,63 +1,63 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
// Code generated by MockGen. DO NOT EDIT.
// Source: tps_limiter.go
+//
+// Generated by this command:
+//
+// mockgen -copyright_file ../.github/mockgen-copyright.txt -source
tps_limiter.go -destination tps/limiter/mock.go -package limiter
+//
-// Package filter is a generated GoMock package.
+// Package limiter is a generated GoMock package.
package limiter
import (
reflect "reflect"
-)
-import (
- gomock "github.com/golang/mock/gomock"
-)
-
-import (
common "dubbo.apache.org/dubbo-go/v3/common"
base "dubbo.apache.org/dubbo-go/v3/protocol/base"
+ gomock "go.uber.org/mock/gomock"
)
-// MockTpsLimiter is a mock of TpsLimiter interface
+// MockTpsLimiter is a mock of TpsLimiter interface.
type MockTpsLimiter struct {
ctrl *gomock.Controller
recorder *MockTpsLimiterMockRecorder
+ isgomock struct{}
}
-// MockTpsLimiterMockRecorder is the mock recorder for MockTpsLimiter
+// MockTpsLimiterMockRecorder is the mock recorder for MockTpsLimiter.
type MockTpsLimiterMockRecorder struct {
mock *MockTpsLimiter
}
-// NewMockTpsLimiter creates a new mock instance
+// NewMockTpsLimiter creates a new mock instance.
func NewMockTpsLimiter(ctrl *gomock.Controller) *MockTpsLimiter {
mock := &MockTpsLimiter{ctrl: ctrl}
mock.recorder = &MockTpsLimiterMockRecorder{mock}
return mock
}
-// EXPECT returns an object that allows the caller to indicate expected use
+// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockTpsLimiter) EXPECT() *MockTpsLimiterMockRecorder {
return m.recorder
}
-// IsAllowable mocks base method
+// IsAllowable mocks base method.
func (m *MockTpsLimiter) IsAllowable(arg0 *common.URL, arg1 base.Invocation)
bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsAllowable", arg0, arg1)
@@ -65,7 +65,7 @@ func (m *MockTpsLimiter) IsAllowable(arg0 *common.URL, arg1
base.Invocation) boo
return ret0
}
-// IsAllowable indicates an expected call of IsAllowable
+// IsAllowable indicates an expected call of IsAllowable.
func (mr *MockTpsLimiterMockRecorder) IsAllowable(arg0, arg1 any) *gomock.Call
{
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAllowable",
reflect.TypeOf((*MockTpsLimiter)(nil).IsAllowable), arg0, arg1)
diff --git a/filter/tps/strategy/mock.go b/filter/tps/strategy/mock.go
index 154d78b78..d75cb5590 100644
--- a/filter/tps/strategy/mock.go
+++ b/filter/tps/strategy/mock.go
@@ -1,58 +1,61 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
// Code generated by MockGen. DO NOT EDIT.
// Source: tps_strategy.go
+//
+// Generated by this command:
+//
+// mockgen -copyright_file ../.github/mockgen-copyright.txt -source
tps_strategy.go -destination tps/strategy/mock.go -package strategy
-exclude_interfaces TpsLimitStrategyCreator
+//
-// Package filter is a generated GoMock package.
+// Package strategy is a generated GoMock package.
package strategy
import (
reflect "reflect"
-)
-import (
- gomock "github.com/golang/mock/gomock"
+ gomock "go.uber.org/mock/gomock"
)
-// MockTpsLimitStrategy is a mock of TpsLimitStrategy interface
+// MockTpsLimitStrategy is a mock of TpsLimitStrategy interface.
type MockTpsLimitStrategy struct {
ctrl *gomock.Controller
recorder *MockTpsLimitStrategyMockRecorder
+ isgomock struct{}
}
-// MockTpsLimitStrategyMockRecorder is the mock recorder for
MockTpsLimitStrategy
+// MockTpsLimitStrategyMockRecorder is the mock recorder for
MockTpsLimitStrategy.
type MockTpsLimitStrategyMockRecorder struct {
mock *MockTpsLimitStrategy
}
-// NewMockTpsLimitStrategy creates a new mock instance
+// NewMockTpsLimitStrategy creates a new mock instance.
func NewMockTpsLimitStrategy(ctrl *gomock.Controller) *MockTpsLimitStrategy {
mock := &MockTpsLimitStrategy{ctrl: ctrl}
mock.recorder = &MockTpsLimitStrategyMockRecorder{mock}
return mock
}
-// EXPECT returns an object that allows the caller to indicate expected use
+// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockTpsLimitStrategy) EXPECT() *MockTpsLimitStrategyMockRecorder {
return m.recorder
}
-// IsAllowable mocks base method
+// IsAllowable mocks base method.
func (m *MockTpsLimitStrategy) IsAllowable() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "IsAllowable")
@@ -60,7 +63,7 @@ func (m *MockTpsLimitStrategy) IsAllowable() bool {
return ret0
}
-// IsAllowable indicates an expected call of IsAllowable
+// IsAllowable indicates an expected call of IsAllowable.
func (mr *MockTpsLimitStrategyMockRecorder) IsAllowable() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAllowable",
reflect.TypeOf((*MockTpsLimitStrategy)(nil).IsAllowable))
diff --git a/filter/tps_limiter.go b/filter/tps_limiter.go
index 59f3cdce6..764d1a7e1 100644
--- a/filter/tps_limiter.go
+++ b/filter/tps_limiter.go
@@ -49,6 +49,7 @@ import (
* tps.interval: 3000
* tps.limit.strategy: "name of implementation" # method-level
*/
+//go:generate go run go.uber.org/mock/[email protected] -copyright_file
../.github/mockgen-copyright.txt -source tps_limiter.go -destination
tps/limiter/mock.go -package limiter
type TpsLimiter interface {
IsAllowable(*common.URL, base.Invocation) bool
}
diff --git a/filter/tps_strategy.go b/filter/tps_strategy.go
index a5c042988..6b1be9931 100644
--- a/filter/tps_strategy.go
+++ b/filter/tps_strategy.go
@@ -20,6 +20,8 @@ package filter
// TpsLimitStrategy is the interface which defines how to do the TPS limiting
in method level.
//
// IsAllowable will return true if this invocation is not over limitation.
+//
+//go:generate go run go.uber.org/mock/[email protected] -copyright_file
../.github/mockgen-copyright.txt -source tps_strategy.go -destination
tps/strategy/mock.go -package strategy -exclude_interfaces
TpsLimitStrategyCreator
type TpsLimitStrategy interface {
IsAllowable() bool
}
diff --git a/go.mod b/go.mod
index e8191a5b3..ba02b1a16 100644
--- a/go.mod
+++ b/go.mod
@@ -22,7 +22,6 @@ require (
github.com/go-playground/validator/v10 v10.12.0
github.com/go-resty/resty/v2 v2.7.0
github.com/go-zookeeper/zk v1.0.4
- github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.4
github.com/google/go-cmp v0.7.0
github.com/google/uuid v1.6.0
@@ -60,6 +59,7 @@ require (
go.opentelemetry.io/otel/sdk v1.21.0
go.opentelemetry.io/otel/trace v1.21.0
go.uber.org/atomic v1.10.0
+ go.uber.org/mock v0.6.0
go.uber.org/zap v1.28.0
go.yaml.in/yaml/v4 v4.0.0-rc.6
golang.org/x/net v0.56.0
@@ -91,6 +91,7 @@ require (
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
+ github.com/golang/mock v1.6.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99 //
indirect
diff --git a/go.sum b/go.sum
index 3d84188b6..230795931 100644
--- a/go.sum
+++ b/go.sum
@@ -883,8 +883,8 @@ go.uber.org/atomic v1.10.0/go.mod
h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0
go.uber.org/goleak v1.1.11/go.mod
h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod
h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
-go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko=
-go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o=
+go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
+go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
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/metadata/report/nacos/report_test.go
b/metadata/report/nacos/report_test.go
index c4f5199e6..828089b52 100644
--- a/metadata/report/nacos/report_test.go
+++ b/metadata/report/nacos/report_test.go
@@ -27,13 +27,13 @@ import (
import (
nacosClient "github.com/dubbogo/gost/database/kv/nacos"
- "github.com/golang/mock/gomock"
-
"github.com/nacos-group/nacos-sdk-go/v2/model"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/protocol/base/base_invoker.go b/protocol/base/base_invoker.go
index 0b45ad290..d2cdbc451 100644
--- a/protocol/base/base_invoker.go
+++ b/protocol/base/base_invoker.go
@@ -49,7 +49,7 @@ var (
// Invoker the service invocation interface for the consumer
// Extension - Invoker
//
-//go:generate mockgen -source invoker.go -destination mock/mock_invoker.go
-self_package dubbo.apache.org/dubbo-go/v3/protocol/mock --package mock Invoker
+//go:generate go run go.uber.org/mock/[email protected] -copyright_file
../../.github/mockgen-copyright.txt -source base_invoker.go -destination
../mock/mock_invoker.go -self_package
dubbo.apache.org/dubbo-go/v3/protocol/mock -package mock -exclude_interfaces
AvailabilitySetter
type Invoker interface {
common.Node
// Invoke the invocation and return result.
diff --git a/protocol/mock/mock_invoker.go b/protocol/mock/mock_invoker.go
index 66a6454a6..e7d28c483 100644
--- a/protocol/mock/mock_invoker.go
+++ b/protocol/mock/mock_invoker.go
@@ -1,22 +1,26 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
// Code generated by MockGen. DO NOT EDIT.
-// Source: invoker.go
+// Source: base_invoker.go
+//
+// Generated by this command:
+//
+// mockgen -copyright_file ../../.github/mockgen-copyright.txt -source
base_invoker.go -destination ../mock/mock_invoker.go -self_package
dubbo.apache.org/dubbo-go/v3/protocol/mock -package mock -exclude_interfaces
AvailabilitySetter
+//
// Package mock is a generated GoMock package.
package mock
@@ -24,22 +28,18 @@ package mock
import (
context "context"
reflect "reflect"
-)
-import (
- gomock "github.com/golang/mock/gomock"
-)
-
-import (
common "dubbo.apache.org/dubbo-go/v3/common"
- protocol "dubbo.apache.org/dubbo-go/v3/protocol/base"
+ base "dubbo.apache.org/dubbo-go/v3/protocol/base"
result "dubbo.apache.org/dubbo-go/v3/protocol/result"
+ gomock "go.uber.org/mock/gomock"
)
// MockInvoker is a mock of Invoker interface.
type MockInvoker struct {
ctrl *gomock.Controller
recorder *MockInvokerMockRecorder
+ isgomock struct{}
}
// MockInvokerMockRecorder is the mock recorder for MockInvoker.
@@ -86,7 +86,7 @@ func (mr *MockInvokerMockRecorder) GetURL() *gomock.Call {
}
// Invoke mocks base method.
-func (m *MockInvoker) Invoke(arg0 context.Context, arg1 protocol.Invocation)
result.Result {
+func (m *MockInvoker) Invoke(arg0 context.Context, arg1 base.Invocation)
result.Result {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Invoke", arg0, arg1)
ret0, _ := ret[0].(result.Result)
diff --git a/registry/directory/directory_test.go
b/registry/directory/directory_test.go
index c6a5be7fc..36fdd6c08 100644
--- a/registry/directory/directory_test.go
+++ b/registry/directory/directory_test.go
@@ -28,10 +28,10 @@ import (
import (
gxset "github.com/dubbogo/gost/container/set"
- "github.com/golang/mock/gomock"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/registry/nacos/registry_test.go b/registry/nacos/registry_test.go
index af131274b..4e156b76f 100644
--- a/registry/nacos/registry_test.go
+++ b/registry/nacos/registry_test.go
@@ -30,10 +30,10 @@ import (
import (
nacosClient "github.com/dubbogo/gost/database/kv/nacos"
- "github.com/golang/mock/gomock"
-
"github.com/nacos-group/nacos-sdk-go/v2/model"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
+
+ "go.uber.org/mock/gomock"
)
import (
diff --git a/tools/dubbogo-cli/cmd/testGenCode/template/newApp/go.sum
b/tools/dubbogo-cli/cmd/testGenCode/template/newApp/go.sum
index 10787c8ad..d946ea37c 100644
--- a/tools/dubbogo-cli/cmd/testGenCode/template/newApp/go.sum
+++ b/tools/dubbogo-cli/cmd/testGenCode/template/newApp/go.sum
@@ -303,16 +303,6 @@ github.com/golang/groupcache
v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4er
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod
h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod
h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod
h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/mock v1.1.1/go.mod
h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.2.0/go.mod
h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.3.1/go.mod
h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
-github.com/golang/mock v1.4.0/go.mod
h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.1/go.mod
h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-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=
github.com/golang/protobuf v1.3.2/go.mod
h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
diff --git a/tools/dubbogo-cli/cmd/testGenCode/template/newDemo/go.sum
b/tools/dubbogo-cli/cmd/testGenCode/template/newDemo/go.sum
index 10787c8ad..d946ea37c 100644
--- a/tools/dubbogo-cli/cmd/testGenCode/template/newDemo/go.sum
+++ b/tools/dubbogo-cli/cmd/testGenCode/template/newDemo/go.sum
@@ -303,16 +303,6 @@ github.com/golang/groupcache
v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4er
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod
h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod
h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod
h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/mock v1.1.1/go.mod
h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.2.0/go.mod
h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.3.1/go.mod
h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
-github.com/golang/mock v1.4.0/go.mod
h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.1/go.mod
h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-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=
github.com/golang/protobuf v1.3.2/go.mod
h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
diff --git a/tools/dubbogo-cli/generator/internal/scaffold/gosum.go
b/tools/dubbogo-cli/generator/internal/scaffold/gosum.go
index 246ca9cdb..12a47b8ab 100644
--- a/tools/dubbogo-cli/generator/internal/scaffold/gosum.go
+++ b/tools/dubbogo-cli/generator/internal/scaffold/gosum.go
@@ -322,16 +322,6 @@ github.com/golang/groupcache
v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4er
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod
h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod
h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod
h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/mock v1.1.1/go.mod
h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.2.0/go.mod
h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.3.1/go.mod
h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
-github.com/golang/mock v1.4.0/go.mod
h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.1/go.mod
h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-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=
github.com/golang/protobuf v1.3.2/go.mod
h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=