// AsFloat should get value from path or return val. func (am ArgMap) AsFloat(aliases ...string) float64 { for _, key := range aliases { f, err := to.Float64(am[key]) if err == nil { return f } } return 0 }
// MayFloat should get value from path or return val. func (am ArgMap) MayFloat(defaultValue float64, aliases ...string) float64 { for _, key := range aliases { f, err := to.Float64(am[key]) if err == nil { return f } } return defaultValue }
// MustFloat should get value from path or return val. func (am ArgMap) MustFloat(aliases ...string) float64 { for _, key := range aliases { f, err := to.Float64(am[key]) if err == nil { return f } } panic(fmt.Sprintf("None of these flags were found or convertable to float64: %v", aliases)) }