Skip to content

Commit

Permalink
hdkeychain: Use errors for test compare.
Browse files Browse the repository at this point in the history
This squashes a lint error by making use of the errors API instead of
reflect for determining if the expected error is received in tests.
  • Loading branch information
davecgh committed Dec 5, 2022
1 parent 0e7920c commit 100d37e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions hdkeychain/extendedkey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"bytes"
"encoding/hex"
"errors"
"reflect"
"testing"

"github.com/decred/dcrd/dcrec/secp256k1/v4"
Expand Down Expand Up @@ -831,7 +830,7 @@ func TestZero(t *testing.T) {

wantErr := ErrNotPrivExtKey
_, err := key.SerializedPrivKey()
if !reflect.DeepEqual(err, wantErr) {
if !errors.Is(err, wantErr) {
t.Errorf("SerializedPrivKey #%d (%s): mismatched "+
"error: want %v, got %v", i, testName, wantErr,
err)
Expand Down

0 comments on commit 100d37e

Please sign in to comment.