From 6f463ac567014f65e28f51a926cdcb174d798de5 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Mon, 12 Jun 2017 19:29:43 +0100 Subject: [PATCH] Add ineffassign to the pre-comiit hooks --- hooks/pre-commit | 1 + src/github.com/matrix-org/dendrite/common/test/client.go | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/hooks/pre-commit b/hooks/pre-commit index 523ce0af2..c30aa3583 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -18,6 +18,7 @@ then exit 1 fi +ineffassign . go tool vet --all --shadow ./src gocyclo -over 12 src/ gb test diff --git a/src/github.com/matrix-org/dendrite/common/test/client.go b/src/github.com/matrix-org/dendrite/common/test/client.go index d8f4fd01c..7d7b0589b 100644 --- a/src/github.com/matrix-org/dendrite/common/test/client.go +++ b/src/github.com/matrix-org/dendrite/common/test/client.go @@ -136,12 +136,8 @@ func (r *Request) Run(label string, timeout time.Duration, serverCmdChan chan er // - the server to exit with an error (error sent on serverCmdChan) // - our test timeout to expire // We don't need to clean up since the main() function handles that in the event we panic - var testPassed bool select { case <-time.After(timeout): - if testPassed { - break - } fmt.Printf("==TESTING== %v TIMEOUT\n", label) if reqErr := r.LastErr.Get(); reqErr != nil { fmt.Println("Last /sync request error:") @@ -157,7 +153,6 @@ func (r *Request) Run(label string, timeout time.Duration, serverCmdChan chan er panic(err) } case <-done: - testPassed = true fmt.Printf("==TESTING== %v PASSED\n", label) } }