Browse Source

Fixes for go vet

Jakob Borg 11 years ago
parent
commit
12d69e25dd

+ 1 - 1
cmd/syncthing/random_test.go

@@ -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)
 		}
 	}
 

+ 1 - 1
internal/ignore/cache_test.go

@@ -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

+ 3 - 3
internal/model/deviceactivity_test.go

@@ -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()