diff options
author | Valery Piashchynski <[email protected]> | 2021-05-27 22:55:45 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-05-27 22:55:45 +0300 |
commit | 9a416cf4f8489a3a0f2c22024bbdf598a20cf41b (patch) | |
tree | 1d07e20db66584adef2a83082a83c803ef54b35e /pkg | |
parent | 2a69d0b5af63d7c9acc36566cab3012e951421d7 (diff) |
- Linters warnings fix
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/bst/bst.go | 1 | ||||
-rw-r--r-- | pkg/bst/bst_test.go | 12 |
2 files changed, 6 insertions, 7 deletions
diff --git a/pkg/bst/bst.go b/pkg/bst/bst.go index bbff91f4..664937ba 100644 --- a/pkg/bst/bst.go +++ b/pkg/bst/bst.go @@ -82,7 +82,6 @@ func (b *BST) removeHelper(uuid string, topic string, parent *BST) { //nolint:go parent = curr curr = curr.right } else { - // if more than 1 topic - remove only topic, do not remove the whole vertex if len(curr.uuids) > 1 { if _, ok := curr.uuids[uuid]; ok { diff --git a/pkg/bst/bst_test.go b/pkg/bst/bst_test.go index f7db68af..4ac9d82f 100644 --- a/pkg/bst/bst_test.go +++ b/pkg/bst/bst_test.go @@ -64,7 +64,7 @@ func BenchmarkBigSearch(b *testing.B) { g2 := NewBST() g3 := NewBST() - var predefinedSlice []string + predefinedSlice := make([]string, 0, 1000) for i := 0; i < 1000; i++ { predefinedSlice = append(predefinedSlice, uuid.NewString()) } @@ -122,7 +122,7 @@ func BenchmarkBigSearchWithRemoves(b *testing.B) { g2 := NewBST() g3 := NewBST() - var predefinedSlice []string + predefinedSlice := make([]string, 0, 1000) for i := 0; i < 1000; i++ { predefinedSlice = append(predefinedSlice, uuid.NewString()) } @@ -157,7 +157,7 @@ func BenchmarkBigSearchWithRemoves(b *testing.B) { for { select { case <-tt.C: - num := rand.Intn(333) + num := rand.Intn(333) //nolint:gosec values := g1.Get(predefinedSlice[num]) for k := range values { g1.Remove(k, predefinedSlice[num]) @@ -275,7 +275,7 @@ func TestBigSearch(t *testing.T) { g2 := NewBST() g3 := NewBST() - var predefinedSlice []string + predefinedSlice := make([]string, 0, 1000) for i := 0; i < 1000; i++ { predefinedSlice = append(predefinedSlice, uuid.NewString()) } @@ -329,7 +329,7 @@ func TestBigSearchWithRemoves(t *testing.T) { g2 := NewBST() g3 := NewBST() - var predefinedSlice []string + predefinedSlice := make([]string, 0, 1000) for i := 0; i < 1000; i++ { predefinedSlice = append(predefinedSlice, uuid.NewString()) } @@ -365,7 +365,7 @@ func TestBigSearchWithRemoves(t *testing.T) { for { select { case <-tt.C: - num := rand.Intn(333) + num := rand.Intn(333) //nolint:gosec values := g1.Get(predefinedSlice[num]) for k := range values { g1.Remove(k, predefinedSlice[num]) |