Fix some error formatting from go vet.
This commit is contained in:
parent
3b6c9b6d78
commit
f8fdabe53b
2 changed files with 4 additions and 4 deletions
|
@ -781,11 +781,11 @@ func JSONToAmount(jsonAmount float64) (int64, error) {
|
|||
var amount int64
|
||||
var err error
|
||||
if jsonAmount > 1.797693134862315708145274237317043567981e+300 {
|
||||
err := fmt.Errorf("Error %d is too large to convert", jsonAmount)
|
||||
err := fmt.Errorf("Error %v is too large to convert", jsonAmount)
|
||||
return amount, err
|
||||
}
|
||||
if jsonAmount < -1.797693134862315708145274237317043567981e+300 {
|
||||
err := fmt.Errorf("Error %d is too small to convert", jsonAmount)
|
||||
err := fmt.Errorf("Error %v is too small to convert", jsonAmount)
|
||||
return amount, err
|
||||
}
|
||||
tempVal := 1e8 * jsonAmount
|
||||
|
|
|
@ -287,11 +287,11 @@ func TestJSONtoAmount(t *testing.T) {
|
|||
res, err := btcjson.JSONToAmount(tt.in)
|
||||
if tt.pass {
|
||||
if res != tt.out || err != nil {
|
||||
t.Errorf("Should not fail: ", tt.in)
|
||||
t.Errorf("Should not fail: %v", tt.in)
|
||||
}
|
||||
} else {
|
||||
if err == nil {
|
||||
t.Errorf("Should not pass: ", tt.in)
|
||||
t.Errorf("Should not pass: %v", tt.in)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue