update:use builtin cmp func (#4879)

This commit is contained in:
me-cs
2025-05-22 23:19:13 +08:00
committed by GitHub
parent e3c371ac89
commit b109b3ef4c
4 changed files with 9 additions and 24 deletions

View File

@@ -10,7 +10,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/zeromicro/go-zero/core/lang"
"github.com/zeromicro/go-zero/core/mathx"
"google.golang.org/grpc/resolver"
)
@@ -47,7 +46,7 @@ func TestDirectBuilder_Build(t *testing.T) {
}, cc, resolver.BuildOptions{})
assert.NoError(t, err)
size := mathx.MinInt(test, subsetSize)
size := min(test, subsetSize)
assert.Equal(t, size, len(cc.state.Addresses))
m := make(map[string]lang.PlaceholderType)
for _, each := range cc.state.Addresses {