From 917f929e7092e93f9d1874704bc40ea426b156bf Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 15 Aug 2018 16:13:54 -0700 Subject: [PATCH] keychain: use t.Helper() instead of manually fetching the line no from the runtime --- keychain/interface_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/keychain/interface_test.go b/keychain/interface_test.go index ef513cab..a297ef96 100644 --- a/keychain/interface_test.go +++ b/keychain/interface_test.go @@ -5,7 +5,6 @@ import ( "io/ioutil" "math/rand" "os" - "runtime" "testing" "time" @@ -94,10 +93,10 @@ func createTestBtcWallet(coinType uint32) (func(), *wallet.Wallet, error) { } func assertEqualKeyLocator(t *testing.T, a, b KeyLocator) { - _, _, line, _ := runtime.Caller(1) + t.Helper() if a != b { - t.Fatalf("line #%v: mismatched key locators: expected %v, "+ - "got %v", line, spew.Sdump(a), spew.Sdump(b)) + t.Fatalf("mismatched key locators: expected %v, "+ + "got %v", spew.Sdump(a), spew.Sdump(b)) } }