mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
all: fix staticcheck warning SA1006
This commit is contained in:
parent
7b5104576e
commit
4709ca3f13
4 changed files with 7 additions and 7 deletions
|
|
@ -86,10 +86,10 @@ func SimulateWalletAddressAndSignFn() (common.Address, func(account accounts.Acc
|
|||
pass := "" // not used but required by API
|
||||
a1, err := ks.NewAccount(pass)
|
||||
if err != nil {
|
||||
return common.Address{}, nil, fmt.Errorf(err.Error())
|
||||
return common.Address{}, nil, err
|
||||
}
|
||||
if err := ks.Unlock(a1, ""); err != nil {
|
||||
return a1.Address, nil, fmt.Errorf(err.Error())
|
||||
return a1.Address, nil, err
|
||||
}
|
||||
return a1.Address, ks.SignHash, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,10 +58,10 @@ func getSignerAndSignFn(pk *ecdsa.PrivateKey) (common.Address, func(account acco
|
|||
pass := "" // not used but required by API
|
||||
a1, err := ks.ImportECDSA(pk, pass)
|
||||
if err != nil {
|
||||
return common.Address{}, nil, fmt.Errorf(err.Error())
|
||||
return common.Address{}, nil, err
|
||||
}
|
||||
if err := ks.Unlock(a1, ""); err != nil {
|
||||
return a1.Address, nil, fmt.Errorf(err.Error())
|
||||
return a1.Address, nil, err
|
||||
}
|
||||
return a1.Address, ks.SignHash, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,10 +88,10 @@ func getSignerAndSignFn(pk *ecdsa.PrivateKey) (common.Address, func(account acco
|
|||
pass := "" // not used but required by API
|
||||
a1, err := ks.ImportECDSA(pk, pass)
|
||||
if err != nil {
|
||||
return common.Address{}, nil, fmt.Errorf(err.Error())
|
||||
return common.Address{}, nil, err
|
||||
}
|
||||
if err := ks.Unlock(a1, ""); err != nil {
|
||||
return a1.Address, nil, fmt.Errorf(err.Error())
|
||||
return a1.Address, nil, err
|
||||
}
|
||||
return a1.Address, ks.SignHash, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ func TestRegistryMarshallJSON(t *testing.T) {
|
|||
r.Register("counter", NewCounter())
|
||||
enc.Encode(r)
|
||||
if s := b.String(); s != "{\"counter\":{\"count\":0}}\n" {
|
||||
t.Fatalf(s)
|
||||
t.Fatal(s)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue