case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
if value.Type().Name() == "Duration" {
defaultValue, err := ToDuration(defVal)
if err != nil {
}
if value.Int() != 0 {
defaultValue = time.Nanosecond * time.Duration(value.Int())
}
val := defaultValue
for _, key := range keys {
val1 := p.GetDurationDefault(key, defaultValue)
if val1 >= 0 {
// 這邊要改成val1<0
val = val1
}
}
value.SetInt(val.Nanoseconds())
}
登录后可查看更多问答,登录/注册