diff --git a/executor.go b/executor.go index b6dc08d41..42fa52005 100644 --- a/executor.go +++ b/executor.go @@ -192,7 +192,7 @@ func (e *Executor) validateCallArgs(c *pql.Call) error { case []int64, []uint64: // noop case []interface{}: - b := make([]int64, len(v), len(v)) + b := make([]int64, len(v)) for i := range v { b[i] = v[i].(int64) } @@ -1554,7 +1554,7 @@ loop: // If a mapping of slices to a node fails then the slices are resplit across // secondary nodes and retried. This continues to occur until all nodes are exhausted. func (e *Executor) mapReduce(ctx context.Context, index string, slices []uint64, c *pql.Call, opt *ExecOptions, mapFn mapFunc, reduceFn reduceFunc) (interface{}, error) { - ch := make(chan mapResponse, 0) + ch := make(chan mapResponse) // Wrap context with a cancel to kill goroutines on exit. ctx, cancel := context.WithCancel(ctx) diff --git a/fragment.go b/fragment.go index 6b5021c99..2ce8eaca4 100644 --- a/fragment.go +++ b/fragment.go @@ -1013,7 +1013,7 @@ func (f *Fragment) Top(opt TopOptions) ([]Pair, error) { } //Pop first opt.N elements out of heap - r := make(Pairs, results.Len(), results.Len()) + r := make(Pairs, results.Len()) x := results.Len() i := 1 for results.Len() > 0 { diff --git a/fragment_test.go b/fragment_test.go index 64f70c14a..2f8c6e622 100644 --- a/fragment_test.go +++ b/fragment_test.go @@ -1179,8 +1179,8 @@ func BenchmarkFragment_FullSnapshot(b *testing.B) { // Generate some intersecting data. maxX := 1048576 / 2 sz := maxX - rows := make([]uint64, sz, sz) - cols := make([]uint64, sz, sz) + rows := make([]uint64, sz) + cols := make([]uint64, sz) max := 0 for row := 0; row < 100; row++ { @@ -1215,8 +1215,8 @@ func BenchmarkFragment_Import(b *testing.B) { defer f.Close() maxX := 1048576 * 5 * 2 sz := maxX - rows := make([]uint64, sz, sz) - cols := make([]uint64, sz, sz) + rows := make([]uint64, sz) + cols := make([]uint64, sz) i := 0 for row := 0; row < 100; row++ { val := 1 diff --git a/holder.go b/holder.go index a4a3ba59c..a80ba4539 100644 --- a/holder.go +++ b/holder.go @@ -75,7 +75,7 @@ type Holder struct { func NewHolder() *Holder { return &Holder{ indexes: make(map[string]*Index), - closing: make(chan struct{}, 0), + closing: make(chan struct{}), opened: make(chan struct{}),