Skip to content

Commit 8c1255e

Browse files
authored
Merge pull request #271 from nspcc-dev/upd-sdk
Use new iterators from NeoFS SDK
2 parents b0d82ab + 046088d commit 8c1255e

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

cmd/neofs-rest-gw/integration_test.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"encoding/json"
99
"fmt"
1010
"io"
11+
"maps"
1112
"mime/multipart"
1213
"net/http"
1314
"net/url"
@@ -1665,10 +1666,7 @@ func restContainerPut(ctx context.Context, t *testing.T, clientPool *pool.Pool)
16651666
cnr, err := clientPool.ContainerGet(ctx, CID, client.PrmContainerGet{})
16661667
require.NoError(t, err)
16671668

1668-
cnrAttr := make(map[string]string)
1669-
cnr.IterateAttributes(func(key, val string) {
1670-
cnrAttr[key] = val
1671-
})
1669+
cnrAttr := maps.Collect(cnr.Attributes())
16721670

16731671
for key, val := range userAttributes {
16741672
require.Equal(t, val, cnrAttr[key])

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/google/uuid v1.6.0
88
github.com/labstack/echo/v4 v4.12.0
99
github.com/nspcc-dev/neo-go v0.108.1
10-
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.13
10+
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.13.0.20250311165714-441b37a4bc03
1111
github.com/oapi-codegen/echo-middleware v1.0.2
1212
github.com/oapi-codegen/runtime v1.1.1
1313
github.com/spf13/pflag v1.0.5

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ github.com/nspcc-dev/hrw/v2 v2.0.3 h1:GUIitIiDpAaQat9SZccp7XVAuwtqaM40+uZ9D8Q4A8
147147
github.com/nspcc-dev/hrw/v2 v2.0.3/go.mod h1:VWlFSGGPcHG1abuIDJb5u83tIF2EqOatC8Z7svZmgWQ=
148148
github.com/nspcc-dev/neo-go v0.108.1 h1:XbtNtDL7O8G1B70WmlPcFXA3fsBGOgXzHxQVfBh6Yv0=
149149
github.com/nspcc-dev/neo-go v0.108.1/go.mod h1:DlISaevW5zhfzg2KgCxtR/m8wQObPuht03kEXSf0g2w=
150-
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.13 h1:q1ne/4d10NuHSqs+fA5XVVBRJ9jSap4cjrsxYzNvYZA=
151-
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.13/go.mod h1:ycdDlPq8Wy+w5ePCmCfbHuEWQXbP7ZjBL5rj3QDiiM0=
150+
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.13.0.20250311165714-441b37a4bc03 h1:hHAt6pUuhkmcCRXKKYa93FGwDMC13kN7sAq3mXR1YAw=
151+
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.13.0.20250311165714-441b37a4bc03/go.mod h1:ycdDlPq8Wy+w5ePCmCfbHuEWQXbP7ZjBL5rj3QDiiM0=
152152
github.com/nspcc-dev/rfc6979 v0.2.3 h1:QNVykGZ3XjFwM/88rGfV3oj4rKNBy+nYI6jM7q19hDI=
153153
github.com/nspcc-dev/rfc6979 v0.2.3/go.mod h1:q3sCL1Ed7homjqYK8KmFSzEmm+7Ngyo7PePbZanhaDE=
154154
github.com/nspcc-dev/tzhash v1.8.2 h1:ebRCbPoEuoqrhC6sSZmrT/jI3h1SzCWakxxV6gp5QAg=

handlers/containers.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,12 @@ func getContainerInfo(ctx context.Context, p *pool.Pool, cnrID cid.ID) (*apiserv
297297
}
298298

299299
var attrs []apiserver.Attribute
300-
cnr.IterateAttributes(func(key, val string) {
300+
for key, val := range cnr.Attributes() {
301301
attrs = append(attrs, apiserver.Attribute{
302302
Key: key,
303303
Value: val,
304304
})
305-
})
305+
}
306306

307307
var sb strings.Builder
308308
if err = cnr.PlacementPolicy().WriteStringTo(&sb); err != nil {

0 commit comments

Comments
 (0)