cmd/faucet: fix period to days conversion

pull/14402/head
Péter Szilágyi 8 years ago
parent 8a28408616
commit 464f30d301
No known key found for this signature in database
GPG Key ID: E9AE538CEDF8293D
  1. 3
      cmd/faucet/faucet.go

@ -108,11 +108,12 @@ func main() {
if period%60 == 0 { if period%60 == 0 {
period /= 60 period /= 60
periods[i] = fmt.Sprintf("%d hours", period) periods[i] = fmt.Sprintf("%d hours", period)
}
if period%24 == 0 { if period%24 == 0 {
period /= 24 period /= 24
periods[i] = fmt.Sprintf("%d days", period) periods[i] = fmt.Sprintf("%d days", period)
} }
}
if period == 1 { if period == 1 {
periods[i] = strings.TrimSuffix(periods[i], "s") periods[i] = strings.TrimSuffix(periods[i], "s")
} }

Loading…
Cancel
Save