mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-11 00:40:00 +08:00
chore: upgrade Go version to 1.24 and update dependencies (#5499)
This commit is contained in:
@@ -65,7 +65,7 @@ func TestDepositServer_Deposit(t *testing.T) {
|
||||
name: "valid request with long handling time",
|
||||
amount: 2000.00,
|
||||
errCode: codes.DeadlineExceeded,
|
||||
errMsg: "context deadline exceeded",
|
||||
// gRPC error message format varies across versions; only check the code
|
||||
},
|
||||
{
|
||||
name: "valid request with timeout call option",
|
||||
@@ -190,7 +190,7 @@ func TestDepositServer_Deposit(t *testing.T) {
|
||||
if e.Code() != tt.errCode {
|
||||
t.Error("error code: expected", codes.InvalidArgument, "received", e.Code())
|
||||
}
|
||||
if e.Message() != tt.errMsg {
|
||||
if tt.errMsg != "" && e.Message() != tt.errMsg {
|
||||
t.Error("error message: expected", tt.errMsg, "received", e.Message())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,11 +11,15 @@ import (
|
||||
"google.golang.org/grpc/resolver"
|
||||
)
|
||||
|
||||
type fakeSubConn struct{ id int }
|
||||
type fakeSubConn struct {
|
||||
balancer.SubConn
|
||||
id int
|
||||
}
|
||||
|
||||
func (f *fakeSubConn) Connect() {}
|
||||
func (f *fakeSubConn) UpdateAddresses(_ []resolver.Address) {}
|
||||
func (f *fakeSubConn) Shutdown() {}
|
||||
func (f *fakeSubConn) Connect() {}
|
||||
func (f *fakeSubConn) UpdateAddresses(_ []resolver.Address) {}
|
||||
func (f *fakeSubConn) Shutdown() {}
|
||||
func (f *fakeSubConn) RegisterHealthListener(func(balancer.SubConnState)) {}
|
||||
func (f *fakeSubConn) GetOrBuildProducer(b balancer.ProducerBuilder) (balancer.Producer, func()) {
|
||||
return nil, func() {}
|
||||
}
|
||||
|
||||
@@ -133,6 +133,7 @@ func TestPickerWithEmptyConns(t *testing.T) {
|
||||
}
|
||||
|
||||
type mockClientConn struct {
|
||||
balancer.SubConn
|
||||
// add random string member to avoid map key equality.
|
||||
id string
|
||||
}
|
||||
@@ -150,3 +151,6 @@ func (m mockClientConn) Connect() {
|
||||
|
||||
func (m mockClientConn) Shutdown() {
|
||||
}
|
||||
|
||||
func (m mockClientConn) RegisterHealthListener(func(balancer.SubConnState)) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user