mirror of
https://github.com/go-ini/ini.git
synced 2026-06-19 21:46:45 +02:00
fix default mapping error
This commit is contained in:
@@ -34,7 +34,7 @@ const (
|
||||
// Maximum allowed depth when recursively substituing variable names.
|
||||
_DEPTH_VALUES = 99
|
||||
|
||||
_VERSION = "1.8.2"
|
||||
_VERSION = "1.8.3"
|
||||
)
|
||||
|
||||
func Version() string {
|
||||
|
||||
@@ -94,13 +94,14 @@ func setWithProperType(t reflect.Type, key *Key, field reflect.Value, delim stri
|
||||
field.SetBool(boolVal)
|
||||
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
||||
durationVal, err := key.Duration()
|
||||
if err == nil {
|
||||
// Skip zero value
|
||||
if err == nil && int(durationVal) > 0 {
|
||||
field.Set(reflect.ValueOf(durationVal))
|
||||
return nil
|
||||
}
|
||||
|
||||
intVal, err := key.Int64()
|
||||
if err != nil {
|
||||
if err != nil || intVal == 0 {
|
||||
return nil
|
||||
}
|
||||
field.SetInt(intVal)
|
||||
|
||||
Reference in New Issue
Block a user