From c3f9f74247cab4e104a0999a75ddeded9e57e689 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 10 Feb 2020 23:28:44 -0800 Subject: [PATCH] ipn: fix lint complaints in tests. Signed-off-by: David Anderson --- ipn/message_test.go | 12 +++++++++++- ipn/prefs_test.go | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ipn/message_test.go b/ipn/message_test.go index 43cca8013..cecafa9f9 100644 --- a/ipn/message_test.go +++ b/ipn/message_test.go @@ -6,9 +6,10 @@ package ipn import ( "bytes" - "tailscale.com/testy" "testing" "time" + + "tailscale.com/testy" ) func TestReadWrite(t *testing.T) { @@ -33,14 +34,23 @@ func TestReadWrite(t *testing.T) { } b, err := ReadMsg(&buf) + if err != nil { + t.Fatalf("read1 error: %v", err) + } if want, got := "Test string1", string(b); want != got { t.Fatalf("read1: %#v != %#v\n", want, got) } b, err = ReadMsg(&buf) + if err != nil { + t.Fatalf("read2 error: %v", err) + } if want, got := "", string(b); want != got { t.Fatalf("read2: %#v != %#v\n", want, got) } b, err = ReadMsg(&buf) + if err != nil { + t.Fatalf("read3 error: %v", err) + } if want, got := "Test3", string(b); want != got { t.Fatalf("read3: %#v != %#v\n", want, got) } diff --git a/ipn/prefs_test.go b/ipn/prefs_test.go index 5163abaa0..467ba0960 100644 --- a/ipn/prefs_test.go +++ b/ipn/prefs_test.go @@ -24,7 +24,7 @@ func checkPrefs(t *testing.T, p Prefs) { if len(b) == 0 { t.Fatalf("default p.ToBytes() failed\n") } - if p != p { + if !p.Equals(&p) { t.Fatalf("p != p\n") } p2 = p