linting: add to Makefile & do some fixes

This commit is contained in:
Zach Ramsay
2017-09-22 11:42:29 -04:00
parent 2130c329eb
commit d6e03d2368
20 changed files with 82 additions and 51 deletions

View File

@ -55,6 +55,7 @@ func TestSmall(t *testing.T) {
This test is quite hacky because it relies on SetFinalizer
which isn't guaranteed to run at all.
*/
// nolint: megacheck
func _TestGCFifo(t *testing.T) {
const numElements = 1000000
@ -102,6 +103,7 @@ func _TestGCFifo(t *testing.T) {
This test is quite hacky because it relies on SetFinalizer
which isn't guaranteed to run at all.
*/
// nolint: megacheck
func _TestGCRandom(t *testing.T) {
const numElements = 1000000
@ -132,7 +134,7 @@ func _TestGCRandom(t *testing.T) {
for _, i := range rand.Perm(numElements) {
el := els[i]
l.Remove(el)
el = el.Next()
_ = el.Next()
}
runtime.GC()
@ -153,7 +155,7 @@ func TestScanRightDeleteRandom(t *testing.T) {
l := New()
stop := make(chan struct{})
els := make([]*CElement, numElements, numElements)
els := make([]*CElement, numElements)
for i := 0; i < numElements; i++ {
el := l.PushBack(i)
els[i] = el