diff --git a/client/errors_test.go b/client/errors_test.go index 90114d7..53872fa 100644 --- a/client/errors_test.go +++ b/client/errors_test.go @@ -33,7 +33,8 @@ func TestErrors(t *testing.T) { { check: client.IsErrSessionExpired, err: new(apistatus.SessionTokenExpired), - }, { + }, + { check: client.IsErrSessionNotFound, err: new(apistatus.SessionTokenNotFound), }, diff --git a/client/netmap.go b/client/netmap.go index f2c2e06..8bedf46 100644 --- a/client/netmap.go +++ b/client/netmap.go @@ -186,8 +186,7 @@ func (c *Client) NetworkInfo(ctx context.Context, prm PrmNetworkInfo) (*ResNetwo } // PrmNetMapSnapshot groups parameters of NetMapSnapshot operation. -type PrmNetMapSnapshot struct { -} +type PrmNetMapSnapshot struct{} // ResNetMapSnapshot groups resulting values of NetMapSnapshot operation. type ResNetMapSnapshot struct { diff --git a/container/container.go b/container/container.go index 9c6c0f8..8c9c447 100644 --- a/container/container.go +++ b/container/container.go @@ -355,7 +355,7 @@ func (x Container) IterateAttributes(f func(key, val string)) { func (x Container) IterateUserAttributes(f func(key, val string)) { attrs := x.v2.GetAttributes() for _, attr := range attrs { - var key = attr.GetKey() + key := attr.GetKey() if !strings.HasPrefix(key, container.SysAttributePrefix) && !strings.HasPrefix(key, container.SysAttributePrefixNeoFS) { f(key, attr.GetValue()) diff --git a/eacl/validator.go b/eacl/validator.go index dd313bb..2ac406a 100644 --- a/eacl/validator.go +++ b/eacl/validator.go @@ -7,8 +7,7 @@ import ( // Validator is a tool that calculates // the action on a request according // to the extended ACL rule table. -type Validator struct { -} +type Validator struct{} // NewValidator creates and initializes a new Validator using options. func NewValidator() *Validator { diff --git a/netmap/bench_test.go b/netmap/bench_test.go index 9793df6..e0dc7c5 100644 --- a/netmap/bench_test.go +++ b/netmap/bench_test.go @@ -53,7 +53,6 @@ func BenchmarkNetmap_ContainerNodes(b *testing.B) { b.Fatal(err) } } - }) } } diff --git a/netmap/policy_test.go b/netmap/policy_test.go index 81b7b48..1d5487b 100644 --- a/netmap/policy_test.go +++ b/netmap/policy_test.go @@ -31,7 +31,7 @@ func TestPlacementPolicyEncoding(t *testing.T) { } func TestPlacementPolicyWriteString(t *testing.T) { - var testCases = []struct { + testCases := []struct { name string input string output string // If the output is empty, make it equal to input. diff --git a/netmap/selector_test.go b/netmap/selector_test.go index 24b2941..934ff7e 100644 --- a/netmap/selector_test.go +++ b/netmap/selector_test.go @@ -99,10 +99,12 @@ func BenchmarkPolicyHRWType(b *testing.B) { p := newPlacementPolicy(1, []ReplicaDescriptor{ newReplica(1, "loc1"), - newReplica(1, "loc2")}, + newReplica(1, "loc2"), + }, []Selector{ newSelector("loc1", "Location", 1, "loc1", (*Selector).SelectSame), - newSelector("loc2", "Location", 1, "loc2", (*Selector).SelectSame)}, + newSelector("loc2", "Location", 1, "loc2", (*Selector).SelectSame), + }, []Filter{ newFilter("loc1", "Location", "Shanghai", netmap.EQ), newFilter("loc2", "Location", "Shanghai", netmap.NE), @@ -144,10 +146,12 @@ func TestPlacementPolicy_DeterministicOrder(t *testing.T) { p := newPlacementPolicy(1, []ReplicaDescriptor{ newReplica(1, "loc1"), - newReplica(1, "loc2")}, + newReplica(1, "loc2"), + }, []Selector{ newSelector("loc1", "Location", 1, "loc1", (*Selector).SelectSame), - newSelector("loc2", "Location", 1, "loc2", (*Selector).SelectSame)}, + newSelector("loc2", "Location", 1, "loc2", (*Selector).SelectSame), + }, []Filter{ newFilter("loc1", "Location", "Shanghai", netmap.EQ), newFilter("loc2", "Location", "Shanghai", netmap.NE), diff --git a/object/transformer/channel_test.go b/object/transformer/channel_test.go index 7a31c7b..cde2e70 100644 --- a/object/transformer/channel_test.go +++ b/object/transformer/channel_test.go @@ -36,7 +36,7 @@ func TestChannelTarget(t *testing.T) { actualIDs := writeObject(t, ctx, chTarget, hdr, payload) _ = expectedIDs _ = actualIDs - //require.Equal(t, expectedIDs, actualIDs) + // require.Equal(t, expectedIDs, actualIDs) for i := range tt.objects { select { diff --git a/pool/tree/client.go b/pool/tree/client.go index d6dd57c..476026f 100644 --- a/pool/tree/client.go +++ b/pool/tree/client.go @@ -23,10 +23,8 @@ type treeClient struct { healthy bool } -var ( - // ErrUnhealthyEndpoint is returned when client in the pool considered unavailable. - ErrUnhealthyEndpoint = errors.New("unhealthy endpoint") -) +// ErrUnhealthyEndpoint is returned when client in the pool considered unavailable. +var ErrUnhealthyEndpoint = errors.New("unhealthy endpoint") // newTreeClient creates new tree client with auto dial. func newTreeClient(addr string, opts ...grpc.DialOption) *treeClient { diff --git a/pool/tree/pool_test.go b/pool/tree/pool_test.go index b0d35f5..f85b656 100644 --- a/pool/tree/pool_test.go +++ b/pool/tree/pool_test.go @@ -211,7 +211,6 @@ func TestRetry(t *testing.T) { checkIndicesAndReset(t, p, 0, 2) p.maxRequestAttempts = oldVal }) - } func TestRebalance(t *testing.T) {