This is an automated email from the ASF dual-hosted git repository.

Similarityoung pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go-pixiu.git


The following commit(s) were added to refs/heads/develop by this push:
     new 5792c1bdd build: migrate github.com/golang/mock to go.uber.org/mock 
(#979)
5792c1bdd is described below

commit 5792c1bdd57a12f7e3f1fbea4a3f66d3acad9358
Author: aias00 <[email protected]>
AuthorDate: Sat Sep 5 20:01:04 2026 +0800

    build: migrate github.com/golang/mock to go.uber.org/mock (#979)
    
    * build: migrate github.com/golang/mock to go.uber.org/mock
    
    Replace the deprecated github.com/golang/mock v1.6.0 with the official
    successor go.uber.org/mock v0.5.2 (API-compatible drop-in replacement).
    
    Changes:
    - go.mod: direct dependency changed from github.com/golang/mock to
      go.uber.org/mock; old package kept as // indirect for transitive deps
    - pkg/config/xds/xds_test.go: import path updated
    - pkg/config/xds/apiclient/grpc_test.go: import path updated
    - pkg/config/xds/cds_test.go: import path updated
    - pkg/server/controls/mocks/mocks.go: import path updated
    
    The gomock API (Controller, EXPECT, etc.) is unchanged — only the
    module path differs. All existing tests pass without modification.
    
    Co-Authored-By: Claude <[email protected]>
    
    * style: fix import ordering for go.uber.org/mock
    
    Move go.uber.org/mock imports after github.com imports to comply
    with the project's imports-formatter CI check.
    
    * style: fix mocks.go import grouping for imports-formatter CI
    
    Separate go.uber.org/mock into its own import block, before the
    github.com block, as required by dubbogo imports-formatter.
    
    ---------
    
    Co-authored-by: Claude <[email protected]>
---
 go.mod                                | 3 ++-
 pkg/config/xds/apiclient/grpc_test.go | 4 ++--
 pkg/config/xds/cds_test.go            | 4 ++--
 pkg/config/xds/xds_test.go            | 4 ++--
 pkg/server/controls/mocks/mocks.go    | 2 +-
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/go.mod b/go.mod
index af4b12c48..7cf502e63 100644
--- a/go.mod
+++ b/go.mod
@@ -27,7 +27,6 @@ require (
        github.com/go-sql-driver/mysql v1.9.2
        github.com/goinggo/mapstructure v0.0.0-20140717182941-194205d9b4a9
        github.com/golang-jwt/jwt/v4 v4.5.2
-       github.com/golang/mock v1.6.0
        github.com/golang/protobuf v1.5.4
        github.com/jhump/protoreflect v1.17.0
        github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
@@ -62,6 +61,7 @@ require (
        go.opentelemetry.io/otel/sdk v1.43.0
        go.opentelemetry.io/otel/sdk/metric v1.43.0
        go.opentelemetry.io/otel/trace v1.43.0
+       go.uber.org/mock v0.5.2
        go.uber.org/zap v1.21.0
        golang.org/x/crypto v0.52.0
        golang.org/x/net v0.55.0
@@ -159,6 +159,7 @@ require (
        github.com/gobwas/glob v0.2.3 // indirect
        github.com/goccy/go-json v0.10.3 // 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/google/uuid v1.6.0 // indirect
diff --git a/pkg/config/xds/apiclient/grpc_test.go 
b/pkg/config/xds/apiclient/grpc_test.go
index ba35e1c4d..2cfd60be6 100644
--- a/pkg/config/xds/apiclient/grpc_test.go
+++ b/pkg/config/xds/apiclient/grpc_test.go
@@ -26,10 +26,10 @@ import (
 import (
        "github.com/agiledragon/gomonkey/v2"
 
-       "github.com/golang/mock/gomock"
-
        "github.com/stretchr/testify/require"
 
+       "go.uber.org/mock/gomock"
+
        "google.golang.org/grpc"
        "google.golang.org/grpc/connectivity"
 )
diff --git a/pkg/config/xds/cds_test.go b/pkg/config/xds/cds_test.go
index 3fae2ebec..6202d682e 100644
--- a/pkg/config/xds/cds_test.go
+++ b/pkg/config/xds/cds_test.go
@@ -27,10 +27,10 @@ import (
 
        core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
 
-       "github.com/golang/mock/gomock"
-
        "github.com/stretchr/testify/require"
 
+       "go.uber.org/mock/gomock"
+
        "google.golang.org/protobuf/types/known/anypb"
 )
 
diff --git a/pkg/config/xds/xds_test.go b/pkg/config/xds/xds_test.go
index adbd7ffe9..a415f7a63 100644
--- a/pkg/config/xds/xds_test.go
+++ b/pkg/config/xds/xds_test.go
@@ -26,10 +26,10 @@ import (
 import (
        "github.com/agiledragon/gomonkey/v2"
 
-       "github.com/golang/mock/gomock"
-
        "github.com/stretchr/testify/require"
 
+       "go.uber.org/mock/gomock"
+
        "google.golang.org/grpc"
        "google.golang.org/grpc/connectivity"
 )
diff --git a/pkg/server/controls/mocks/mocks.go 
b/pkg/server/controls/mocks/mocks.go
index cec692e0f..8a150f947 100644
--- a/pkg/server/controls/mocks/mocks.go
+++ b/pkg/server/controls/mocks/mocks.go
@@ -22,7 +22,7 @@ import (
 )
 
 import (
-       gomock "github.com/golang/mock/gomock"
+       gomock "go.uber.org/mock/gomock"
 )
 
 import (

Reply via email to