1
0
Fork 0

Update github.com/xenolf/lego to 0.4.1

This commit is contained in:
Tait Clarridge 2017-10-31 05:42:03 -04:00 committed by Traefiker
parent 5042c5bf40
commit e8d63b2a3b
105 changed files with 4299 additions and 2075 deletions

View file

@ -35,19 +35,31 @@ func (a *AccountInfo) UnmarshalJSON(data []byte) (err error) {
return err
}
b, err := strconv.ParseFloat(fmt.Sprintf("%v", fields["balance"]), 64)
value := fmt.Sprintf("%v", fields["balance"])
if len(value) == 0 || value == "<nil>" {
value = "0"
}
b, err := strconv.ParseFloat(value, 64)
if err != nil {
return err
}
a.Balance = b
pc, err := strconv.ParseFloat(fmt.Sprintf("%v", fields["pending_charges"]), 64)
value = fmt.Sprintf("%v", fields["pending_charges"])
if len(value) == 0 || value == "<nil>" {
value = "0"
}
pc, err := strconv.ParseFloat(value, 64)
if err != nil {
return err
}
a.PendingCharges = pc
lpa, err := strconv.ParseFloat(fmt.Sprintf("%v", fields["last_payment_amount"]), 64)
value = fmt.Sprintf("%v", fields["last_payment_amount"])
if len(value) == 0 || value == "<nil>" {
value = "0"
}
lpa, err := strconv.ParseFloat(value, 64)
if err != nil {
return err
}