1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

graphdriver/aufs: SA4021: x = append(y) is equivalent to x = y (staticcheck)

```
daemon/graphdriver/aufs/aufs_test.go:746:8: SA4021: x = append(y) is equivalent to x = y (staticcheck)
	ids = append(ids[2:])
	      ^
```

Also pre-allocating the ids slice while we're at it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-10-12 16:07:00 +02:00
parent 301a2fbeca
commit 94647b5d86
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -729,9 +729,9 @@ func BenchmarkConcurrentAccess(b *testing.B) {
numConcurrent := 256
// create a bunch of ids
var ids []string
ids := make([]string, numConcurrent)
for i := 0; i < numConcurrent; i++ {
ids = append(ids, stringid.GenerateRandomID())
ids[i] = stringid.GenerateRandomID()
}
if err := d.Create(ids[0], "", nil); err != nil {
@ -743,7 +743,7 @@ func BenchmarkConcurrentAccess(b *testing.B) {
}
parent := ids[1]
ids = append(ids[2:])
ids = ids[2:]
chErr := make(chan error, numConcurrent)
var outerGroup sync.WaitGroup