From 68f3da9cd0b6e3de5d3029331c7b4ad7705f1064 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Mon, 22 Jul 2019 08:59:31 +0200 Subject: [PATCH] Unlambda test functions No need to wrap these functions, they already have a matching signature. --- client_test.go | 8 ++------ helpers_test.go | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/client_test.go b/client_test.go index d293b6d..829e365 100644 --- a/client_test.go +++ b/client_test.go @@ -1275,9 +1275,7 @@ func TestClientRTOAgentErr(t *testing.T) { connL, connR := net.Pipe() defer connL.Close() collector := new(manualCollector) - clock := callbackClock(func() time.Time { - return time.Now() - }) + clock := callbackClock(time.Now) agent := &manualAgent{} attempt := 0 gotReads := make(chan struct{}) @@ -1341,9 +1339,7 @@ func TestClient_HandleProcessError(t *testing.T) { connL, connR := net.Pipe() defer connL.Close() collector := new(manualCollector) - clock := callbackClock(func() time.Time { - return time.Now() - }) + clock := callbackClock(time.Now) agent := &manualAgent{} gotWrites := make(chan struct{}) processCalled := make(chan struct{}, 1) diff --git a/helpers_test.go b/helpers_test.go index 2aad636..42613ce 100644 --- a/helpers_test.go +++ b/helpers_test.go @@ -192,9 +192,7 @@ func TestMessage_ForEach(t *testing.T) { m = newMessage() var realm Realm testutil.ShouldNotAllocate(t, func() { - if err := m.ForEach(AttrRealm, func(m *Message) error { - return realm.GetFrom(m) - }); err != nil { + if err := m.ForEach(AttrRealm, realm.GetFrom); err != nil { t.Fatal(err) } })