From 3ebea78bc3e8b613c3495d5cd501e4cd60863821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Sun, 10 Jan 2021 16:55:19 +0100 Subject: [PATCH] Fix Errorf formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #9. Signed-off-by: Robert-André Mauchin --- filelock/file_lock_test.go | 2 +- list2/list_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/filelock/file_lock_test.go b/filelock/file_lock_test.go index 3575fc2..6377a17 100644 --- a/filelock/file_lock_test.go +++ b/filelock/file_lock_test.go @@ -40,7 +40,7 @@ func TestLock(t *testing.T) { // Avoid truncating an existing, non-empty file. fi, err := os.Stat(filename) if err == nil && fi.Size() != 0 { - t.Fatal("The file %s is not empty", filename) + t.Fatalf("The file %s is not empty", filename) } t.Logf("Locking %s\n", filename) diff --git a/list2/list_test.go b/list2/list_test.go index 3ab21fd..ddb0e2f 100644 --- a/list2/list_test.go +++ b/list2/list_test.go @@ -57,7 +57,7 @@ func checkListPointers(t *testing.T, l *List, es []*Element) { Prev = prev } if p := e.prev; p != prev.index { - t.Errorf("elt[%d](%p).prev = %p, want %p", i, e, p, prev) + t.Errorf("elt[%d](%p).prev = %d, want %p", i, e, p, prev) } if p := e.Prev(); p != Prev { t.Errorf("elt[%d](%p).Prev() = %p, want %p", i, e, p, Prev) @@ -70,7 +70,7 @@ func checkListPointers(t *testing.T, l *List, es []*Element) { Next = next } if n := e.next; n != next.index { - t.Errorf("elt[%d](%p).next = %p, want %p", i, e, n, next) + t.Errorf("elt[%d](%p).next = %d, want %p", i, e, n, next) } if n := e.Next(); n != Next { t.Errorf("elt[%d](%p).Next() = %p, want %p", i, e, n, Next)