mirror of https://github.com/perkeep/perkeep.git
jsonconfig: remove TODO and revert bogus change; float always works apparently.
Change-Id: Ia80edbfd122063895ffb76d361c33b2cd70a725c
This commit is contained in:
parent
159c2a5216
commit
41e8215abe
|
@ -160,13 +160,8 @@ func (jc Obj) int(key string, def *int) int {
|
|||
}
|
||||
b, ok := ei.(float64)
|
||||
if !ok {
|
||||
// TODO(mpl): float or int? or both allowed? use a switch?
|
||||
c, ok := ei.(int)
|
||||
if !ok {
|
||||
jc.appendError(fmt.Errorf("Expected config key %q to be a number", key))
|
||||
return 0
|
||||
}
|
||||
return int(c)
|
||||
jc.appendError(fmt.Errorf("Expected config key %q to be a number", key))
|
||||
return 0
|
||||
}
|
||||
return int(b)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue