[#190] sdk-go: Gofumpt fixes
DCO / DCO (pull_request) Successful in 56s Details
Tests and linters / Tests (1.21) (pull_request) Successful in 1m16s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 1m13s Details
Tests and linters / Lint (pull_request) Successful in 2m20s Details

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
pull/195/head
Dmitrii Stepanov 2023-11-21 12:57:35 +03:00
parent 157a9930e8
commit 56debcfa56
10 changed files with 17 additions and 18 deletions

View File

@ -33,7 +33,8 @@ func TestErrors(t *testing.T) {
{
check: client.IsErrSessionExpired,
err: new(apistatus.SessionTokenExpired),
}, {
},
{
check: client.IsErrSessionNotFound,
err: new(apistatus.SessionTokenNotFound),
},

View File

@ -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 {

View File

@ -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())

View File

@ -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 {

View File

@ -53,7 +53,6 @@ func BenchmarkNetmap_ContainerNodes(b *testing.B) {
b.Fatal(err)
}
}
})
}
}

View File

@ -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.

View File

@ -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),

View File

@ -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 {

View File

@ -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 {

View File

@ -211,7 +211,6 @@ func TestRetry(t *testing.T) {
checkIndicesAndReset(t, p, 0, 2)
p.maxRequestAttempts = oldVal
})
}
func TestRebalance(t *testing.T) {