chore: upgrade Go version to 1.24 and update dependencies (#5499)

This commit is contained in:
Kevin Wan
2026-03-22 18:47:43 +08:00
committed by GitHub
parent 9a6447ab5c
commit ba9c275853
15 changed files with 290 additions and 231 deletions

View File

@@ -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())
}
}

View File

@@ -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() {}
}

View File

@@ -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)) {
}