Fix reported anti patterns (#7501)

* merge var decl

* single append

* replace bytes.Compare -> bytes.Equal

* remove redundant spritnf

* remove redundant spritnf

* trimprefix

* remove redundant nil check

* remove redundant return

* plain channel or unblock on context closing

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Victor Farazdagi
2020-10-12 19:12:00 +03:00
committed by GitHub
parent a019a0db4c
commit ac1a4a078c
17 changed files with 45 additions and 56 deletions

View File

@@ -311,6 +311,9 @@ func TestBlocksFetcher_RoundRobin(t *testing.T) {
}
wg.Done()
case <-ctx.Done():
log.Debug("Context closed, exiting goroutine")
return unionRespBlocks, nil
}
}
}