Skip to content

Commit

Permalink
style(blobstore): fix some golangci checks
Browse files Browse the repository at this point in the history
Signed-off-by: slasher <[email protected]>
  • Loading branch information
sejust committed Jul 6, 2023
1 parent 34368f9 commit 9ed7882
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
1 change: 0 additions & 1 deletion blobstore/blobnode/core/chunk/compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ COMPACT:
if err != nil {
if err == core.ErrChunkScanEOF {
span.Infof("chunk %s scan finished", cs.ID())
err = nil
break COMPACT
} else {
span.Errorf("scan chunk meta(%s) failed: %v", cs.ID(), err)
Expand Down
4 changes: 2 additions & 2 deletions blobstore/cli/common/cfmt/access_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ func TestParseLocation(t *testing.T) {
},
}

locx, err := cfmt.ParseLocation("")
_, err := cfmt.ParseLocation("")
require.Error(t, err)

_, err = cfmt.ParseLocation("xxxx")
require.Error(t, err)

locx, err = cfmt.ParseLocation("{}")
locx, err := cfmt.ParseLocation("{}")
require.NoError(t, err)
require.Equal(t, access.Location{}, locx)

Expand Down
6 changes: 1 addition & 5 deletions blobstore/clustermgr/diskmgr/alloc.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,7 @@ func (s *idcStorage) allocFromBlobNodeStorages(ctx context.Context, count int, t

for _, diskInfo := range excludes {
diskInfo.lock.RLock()
if excludeHosts == nil {
excludeHosts = map[string]bool{diskInfo.info.Host: true}
} else {
excludeHosts[diskInfo.info.Host] = true
}
excludeHosts[diskInfo.info.Host] = true
diskInfo.lock.RUnlock()
}

Expand Down
5 changes: 2 additions & 3 deletions blobstore/clustermgr/diskmgr/alloc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package diskmgr

import (
"context"
"fmt"
"math/rand"
"os"
"strconv"
Expand Down Expand Up @@ -123,7 +122,7 @@ func TestAlloc(t *testing.T) {
// refresh cluster's disk space allocator
testDiskMgr.refresh(ctx)

t.Log(fmt.Sprintf("all disk length: %d", len(testDiskMgr.allDisks)))
t.Logf("all disk length: %d", len(testDiskMgr.allDisks))

// alloc from not enough space, alloc should return ErrNoEnoughSpace
for _, idc := range testIdcs {
Expand Down Expand Up @@ -235,7 +234,7 @@ func TestAllocWithSameHost(t *testing.T) {
testDiskMgr.RackAware = false
testDiskMgr.refresh(ctx)

t.Log(fmt.Sprintf("all disk length: %d", len(testDiskMgr.allDisks)))
t.Logf("all disk length: %d", len(testDiskMgr.allDisks))

// alloc from not enough space, alloc should return ErrNoEnoughSpace
for _, idc := range testIdcs {
Expand Down

0 comments on commit 9ed7882

Please sign in to comment.