Skip to content

Commit

Permalink
Fix staticcheck failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
kisom committed Dec 14, 2016
1 parent 9bd4411 commit 06c1874
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 0 additions & 2 deletions transport/core/backoff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ func TestTries(t *testing.T) {
for i := uint64(0); i < 3; i++ {
if b.n != i {
t.Fatalf("want tries=%d, have tries=%d", i, b.n)
} else if b.n != i {
t.Fatalf("want tries=%d, have tries=%d", i, b.n)
}

pow := 1 << i
Expand Down
4 changes: 2 additions & 2 deletions transport/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func testListen(t *testing.T) {
log.Debug("listener waiting for connection")
conn, err := l.Accept()
if err != nil {
t.Fatalf("%v", err)
panic(err.Error())
}

log.Debugf("client has connected")
Expand Down Expand Up @@ -243,7 +243,7 @@ func TestListener(t *testing.T) {
go func() {
err := <-errChan
if err != nil {
t.Fatalf("listener auto update failed: %v", err)
panic("listener auto update failed: " + err.Error())
}
}()

Expand Down
2 changes: 1 addition & 1 deletion ubiquity/ubiquity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ func TestSHA1DeprecationMessages(t *testing.T) {
chain2 := []*x509.Certificate{cert1, cert1}
chain3 := []*x509.Certificate{cert2, cert1, cert1}
chain4 := []*x509.Certificate{cert2, cert2, cert1}
messages := []string{}
var messages []string

Jan1st2014 := time.Date(2014, time.January, 1, 0, 0, 0, 0, time.UTC)
Jan1st2100 := time.Date(2100, time.January, 1, 0, 0, 0, 0, time.UTC)
Expand Down
5 changes: 3 additions & 2 deletions whitelist/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package whitelist

import (
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
"strings"
Expand Down Expand Up @@ -42,7 +43,7 @@ func testWorker(url string, t *testing.T, wg *sync.WaitGroup) {
for i := 0; i < 100; i++ {
response := testHTTPResponse(url, t)
if response != "NO" {
t.Fatalf("Expected NO, but got %s", response)
log.Fatalf("Expected NO, but got %s", response)
}
}
wg.Done()
Expand Down Expand Up @@ -360,7 +361,7 @@ func TestSetupNetHandlerFunc(t *testing.T) {
wl := NewBasicNet()
h, err := NewHandlerFunc(testAllowHandlerFunc, testDenyHandlerFunc, wl)
if err != nil {
t.Fatalf("%v", err)
log.Fatalf("%v", err)
}

srv := httptest.NewServer(h)
Expand Down
7 changes: 4 additions & 3 deletions whitelist/whitelist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"io/ioutil"
"log"
"net"
"net/http"
"testing"
Expand Down Expand Up @@ -154,7 +155,7 @@ var proceed = make(chan struct{}, 0)
func setupTestServer(t *testing.T, wl ACL) {
ln, err := net.Listen("tcp", "127.0.0.1:4141")
if err != nil {
t.Fatalf("%v", err)
log.Fatalf("%v", err)
}
proceed <- struct{}{}
for {
Expand All @@ -166,7 +167,7 @@ func setupTestServer(t *testing.T, wl ACL) {
default:
conn, err := ln.Accept()
if err != nil {
t.Fatalf("%v", err)
log.Fatalf("%v", err)
}
go handleTestConnection(conn, wl, t)
}
Expand All @@ -177,7 +178,7 @@ func handleTestConnection(conn net.Conn, wl ACL, t *testing.T) {
defer conn.Close()
ip, err := NetConnLookup(conn)
if err != nil {
t.Fatalf("%v", err)
log.Fatalf("%v", err)
}

if wl.Permitted(ip) {
Expand Down

0 comments on commit 06c1874

Please sign in to comment.