mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-31 18:48:08 +00:00
cleanup unused code and fix t.Fatal usage in goroutine in testing (#11694)
This commit is contained in:
@@ -261,13 +261,13 @@ func humanDuration(d time.Duration) string {
|
||||
// humanDurationInt prints the given int as if it were a time.Duration number
|
||||
// of seconds.
|
||||
func humanDurationInt(i interface{}) interface{} {
|
||||
switch i.(type) {
|
||||
switch i := i.(type) {
|
||||
case int:
|
||||
return humanDuration(time.Duration(i.(int)) * time.Second)
|
||||
return humanDuration(time.Duration(i) * time.Second)
|
||||
case int64:
|
||||
return humanDuration(time.Duration(i.(int64)) * time.Second)
|
||||
return humanDuration(time.Duration(i) * time.Second)
|
||||
case json.Number:
|
||||
if i, err := i.(json.Number).Int64(); err == nil {
|
||||
if i, err := i.Int64(); err == nil {
|
||||
return humanDuration(time.Duration(i) * time.Second)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user