forked from TrueCloudLab/frostfs-contract
[#184] *: Cast to struct `iterator.Value() k/v pair
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
5e604b6f8b
commit
53a6b198d9
2 changed files with 10 additions and 8 deletions
|
@ -521,10 +521,11 @@ func ListConfig() []record {
|
|||
|
||||
it := storage.Find(ctx, configPrefix, storage.None)
|
||||
for iterator.Next(it) {
|
||||
pair := iterator.Value(it).([]interface{})
|
||||
key := pair[0].([]byte)
|
||||
val := pair[1].([]byte)
|
||||
r := record{key: key[len(configPrefix):], val: val}
|
||||
pair := iterator.Value(it).(struct {
|
||||
key []byte
|
||||
val []byte
|
||||
})
|
||||
r := record{key: pair.key[len(configPrefix):], val: pair.val}
|
||||
|
||||
config = append(config, r)
|
||||
}
|
||||
|
|
|
@ -482,10 +482,11 @@ func ListConfig() []record {
|
|||
|
||||
it := storage.Find(ctx, configPrefix, storage.None)
|
||||
for iterator.Next(it) {
|
||||
pair := iterator.Value(it).([]interface{})
|
||||
key := pair[0].([]byte)
|
||||
val := pair[1].([]byte)
|
||||
r := record{key: key[len(configPrefix):], val: val}
|
||||
pair := iterator.Value(it).(struct {
|
||||
key []byte
|
||||
val []byte
|
||||
})
|
||||
r := record{key: pair.key[len(configPrefix):], val: pair.val}
|
||||
|
||||
config = append(config, r)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue