Int returns the int value of a given key path or 0 if the path does not exist or if the value is not a valid int.
(path string)
| 126 | // Int returns the int value of a given key path or 0 if the path |
| 127 | // does not exist or if the value is not a valid int. |
| 128 | func (ko *Koanf) Int(path string) int { |
| 129 | return int(ko.Int64(path)) |
| 130 | } |
| 131 | |
| 132 | // MustInt returns the int value of a given key path or panics |
| 133 | // if it isn't set or set to default value of 0. |