示例#1
0
文件: parameter.go 项目: TMaYaD/clif
// Bool representation of the value (will be false, if not given or not parsable)
func (this *parameter) Bool() bool {
	if this.Values == nil {
		return false
	} else {
		return reflekt.AsBool(this.Values[0])
	}
}
示例#2
0
文件: parameter.go 项目: TMaYaD/clif
// Bools returns values as bool array (values will be false, if not parsable to float64)
func (this *parameter) Bools() []bool {
	if this.Values == nil {
		return nil
	} else {
		res := make([]bool, this.Count())
		for i, v := range this.Values {
			res[i] = reflekt.AsBool(v)
		}
		return res
	}
}