forked from TrueCloudLab/frostfs-sdk-go
*: Fix linter warnings
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
b5874778e9
commit
fa670ab57a
4 changed files with 2 additions and 23 deletions
|
@ -36,6 +36,7 @@ func FromStatusV2(st *status.Status) Status {
|
||||||
|
|
||||||
switch code := st.Code(); {
|
switch code := st.Code(); {
|
||||||
case status.IsSuccess(code):
|
case status.IsSuccess(code):
|
||||||
|
//nolint:exhaustive
|
||||||
switch status.LocalizeSuccess(&code); code {
|
switch status.LocalizeSuccess(&code); code {
|
||||||
case status.OK:
|
case status.OK:
|
||||||
decoder = new(SuccessDefaultV2)
|
decoder = new(SuccessDefaultV2)
|
||||||
|
|
|
@ -3,7 +3,6 @@ package netmap
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
subnetid "github.com/nspcc-dev/neofs-sdk-go/subnet/id"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -43,12 +42,6 @@ func newReplica(c uint32, s string) *Replica {
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
func newSubnetID(id uint32) *subnetid.ID {
|
|
||||||
var s subnetid.ID
|
|
||||||
s.SetNumber(id)
|
|
||||||
return &s
|
|
||||||
}
|
|
||||||
|
|
||||||
func nodeInfoFromAttributes(props ...string) NodeInfo {
|
func nodeInfoFromAttributes(props ...string) NodeInfo {
|
||||||
attrs := make([]*NodeAttribute, len(props)/2)
|
attrs := make([]*NodeAttribute, len(props)/2)
|
||||||
for i := range attrs {
|
for i := range attrs {
|
||||||
|
@ -61,14 +54,6 @@ func nodeInfoFromAttributes(props ...string) NodeInfo {
|
||||||
return *n
|
return *n
|
||||||
}
|
}
|
||||||
|
|
||||||
func getTestNode(props ...string) *Node {
|
|
||||||
m := make(map[string]string, len(props)/2)
|
|
||||||
for i := 0; i < len(props); i += 2 {
|
|
||||||
m[props[i]] = props[i+1]
|
|
||||||
}
|
|
||||||
return &Node{AttrMap: m}
|
|
||||||
}
|
|
||||||
|
|
||||||
type enumIface interface {
|
type enumIface interface {
|
||||||
FromString(string) bool
|
FromString(string) bool
|
||||||
String() string
|
String() string
|
||||||
|
|
|
@ -181,7 +181,6 @@ type clientPack struct {
|
||||||
type CallOption func(config *callConfig)
|
type CallOption func(config *callConfig)
|
||||||
|
|
||||||
type callConfig struct {
|
type callConfig struct {
|
||||||
isRetry bool
|
|
||||||
useDefaultSession bool
|
useDefaultSession bool
|
||||||
|
|
||||||
key *ecdsa.PrivateKey
|
key *ecdsa.PrivateKey
|
||||||
|
@ -207,12 +206,6 @@ func WithSession(token *session.Token) CallOption {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func retry() CallOption {
|
|
||||||
return func(config *callConfig) {
|
|
||||||
config.isRetry = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func useDefaultSession() CallOption {
|
func useDefaultSession() CallOption {
|
||||||
return func(config *callConfig) {
|
return func(config *callConfig) {
|
||||||
config.useDefaultSession = true
|
config.useDefaultSession = true
|
||||||
|
|
|
@ -357,7 +357,7 @@ func TestSessionCache(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Contains(t, tokens, st)
|
require.Contains(t, tokens, st)
|
||||||
|
|
||||||
_, err = pool.GetObject(ctx, address.Address{}, retry())
|
_, err = pool.GetObject(ctx, address.Address{})
|
||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
|
|
||||||
// cache must not contain session token
|
// cache must not contain session token
|
||||||
|
|
Loading…
Reference in a new issue