Fixes for go vet

This commit is contained in:
Jakob Borg 2014-12-08 16:19:08 +01:00
parent 0c9f1efc75
commit 12d69e25dd
3 changed files with 5 additions and 5 deletions

View File

@ -46,7 +46,7 @@ func TestRandomString(t *testing.T) {
for _, l := range []int{0, 1, 2, 3, 4, 8, 42} {
s := randomString(l)
if len(s) != l {
t.Errorf("Incorrect length %d != %s", len(s), l)
t.Errorf("Incorrect length %d != %d", len(s), l)
}
}

View File

@ -25,7 +25,7 @@ func TestCache(t *testing.T) {
res, ok := c.get("nonexistent")
if res != false || ok != false {
t.Error("res %v, ok %v for nonexistent item", res, ok)
t.Errorf("res %v, ok %v for nonexistent item", res, ok)
}
// Set and check some items

View File

@ -22,9 +22,9 @@ import (
)
func TestDeviceActivity(t *testing.T) {
n0 := protocol.DeviceID{1, 2, 3, 4}
n1 := protocol.DeviceID{5, 6, 7, 8}
n2 := protocol.DeviceID{9, 10, 11, 12}
n0 := protocol.DeviceID([32]byte{1, 2, 3, 4})
n1 := protocol.DeviceID([32]byte{5, 6, 7, 8})
n2 := protocol.DeviceID([32]byte{9, 10, 11, 12})
devices := []protocol.DeviceID{n0, n1, n2}
na := newDeviceActivity()