diff --git a/client/client.go b/client/client.go index d4a3e3bd..51488389 100644 --- a/client/client.go +++ b/client/client.go @@ -8,7 +8,6 @@ import ( "fmt" netmap "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc" "net/url" - "slices" "time" v2accounting "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting" @@ -119,10 +118,23 @@ func (c *Client) NetMapDial(ctx context.Context, endpoint string) error { if err != nil { return err } + + isEqualSlices := func(a, b []byte) bool { + if len(a) != len(b) { + return false + } + for i := range a { + if a[i] != b[i] { + return false + } + } + return true + } + if u.Scheme == "frostfs" { nodes := c.prm.NetMap.GetNodes() for _, node := range nodes { - if slices.Equal([]byte(u.Host), node.PublicKey) { + if isEqualSlices([]byte(u.Host), node.PublicKey) { return c.Dial(ctx, PrmDial{Endpoint: node.Addresses[0]}) } }