staros/sysconf/typed.go

29 lines
500 B
Go
Raw Normal View History

2020-06-08 14:52:16 +08:00
package sysconf
import "strconv"
func (s *Section) Uint64(key string) uint64 {
v, _ := strconv.ParseUint(s.Get(key), 10, 64)
return v
}
func (s *Section) MustInt(key string) int {
return s.Int(key)
}
func (s *Section) MustInt64(key string) int64 {
return s.Int64(key)
}
func (s *Section) MustUint64(key string) uint64 {
return s.Uint64(key)
}
func (s *Section) MustBool(key string) bool {
return s.Bool(key)
}
func (s *Section) MustFloat64(key string) float64 {
return s.Float64(key)
}