keychain: use t.Helper() instead of manually fetching the line no from the runtime

This commit is contained in:
Olaoluwa Osuntokun 2018-08-15 16:13:54 -07:00
parent 1ff596ecd7
commit 917f929e70
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -5,7 +5,6 @@ import (
"io/ioutil" "io/ioutil"
"math/rand" "math/rand"
"os" "os"
"runtime"
"testing" "testing"
"time" "time"
@ -94,10 +93,10 @@ func createTestBtcWallet(coinType uint32) (func(), *wallet.Wallet, error) {
} }
func assertEqualKeyLocator(t *testing.T, a, b KeyLocator) { func assertEqualKeyLocator(t *testing.T, a, b KeyLocator) {
_, _, line, _ := runtime.Caller(1) t.Helper()
if a != b { if a != b {
t.Fatalf("line #%v: mismatched key locators: expected %v, "+ t.Fatalf("mismatched key locators: expected %v, "+
"got %v", line, spew.Sdump(a), spew.Sdump(b)) "got %v", spew.Sdump(a), spew.Sdump(b))
} }
} }