// MustBool always returns value without error,
// it returns false if error occurs.
485982
func (k *Key) MustBool(defaultVal ...bool) bool {
	val, err := k.Bool()
	if len(defaultVal) > 0 && err != nil {
		k.value = strconv.FormatBool(defaultVal[0])
		return defaultVal[0]
	}
	return val
}
566590
func (context *BaseContext) GetBool(
	key string, defaultValue ...bool) bool {
	if value, ok := context.userData[key]; ok {
		if value, ok := value.(bool); ok {
			return value
		}
	}
	if len(defaultValue) > 0 {
		return defaultValue[0]
	}
	return false
}
948885
func (env *Env) GetBool(key string) (value bool) {
	s := strings.ToLower(strings.Trim(env.Get(key), " \t"))
	if s == "" || s == "0" || s == "no" || s == "false" || s == "none" {
		return false
	}
	return true
}
1161106
func toBool(v reflect.Value) bool {
	b, _ := tryToBool(v)
	return b
}
634651
func (p *Partial) Bool() (b bool, err error) {
	err = p.Unmarshal(&b)
	return
}
394098
func (f *Queries) MustBool(key string, defaults ...bool) bool {
	if v, ok := f.Values()[key]; ok {
		i, err := strconv.ParseBool(v[0])
		if err == nil {
			return i
		}
	}
	if len(defaults) > 0 {
		return defaults[0]
	}
	return false
}
1136099
func (m Metadata) GetBool(key string) (*bool, error) {
	val, ok := m[key]
	if !ok {
		return nil, ErrMetadataNonexistantKey
	}
	if val.Type != MetadataValueTypeBool {
		return nil, ErrMetadataUnexpectedValueType
	}
	out, _ := val.Value.(bool)
	return &out, nil
}
399149
func ParseBool(s string) (bool, error) {
	v, err := boolParser.Parse(s)
	if err != nil {
		return false, err
	}
	return v.(bool), nil
}
808503
func Bool(b bool) NullBool {
	return NullBool{
		sql.NullBool{
			Bool:  b,
			Valid: true,
		},
	}
}
601153
func (dec *Decoder) Bool(v *bool) error {
	err := dec.decodeBool(v)
	if err != nil {
		return err
	}
	dec.called |= 1
	return nil
}
412084
func ToBool(v string) bool {
	if strings.TrimSpace(strings.ToLower(v)) == "true" {
		return true
	}
	return false
}
516443
func TryToBool(i interface{}) (b bool, err error) {
	switch v := i.(type) {
	case nil:
	case bool:
		b = v
	case *bool:
		b = *v
	case string:
		b, err = strconv.ParseBool(v)
	case *string:
		b, err = strconv.ParseBool(*v)
	case int, int8, int16, int32, int64:
		b = v != 0
	default:
		err = castError(i, "bool")
	}
	return
}
1300537
func (c *JSONConfigContainer) Bool(key string) (bool, error) {
	val := c.getData(key)
	if val != nil {
		return ParseBool(val)
	}
	return false, fmt.Errorf("not exist key: %q", key)
}
522819
func (r *Reader) MustBool(name string) bool {
	b, err := r.readBool(name)
	if err != nil {
		panic(err)
	}
	return b
}
1302036
func ParseBool(value string, defaultValue bool) (bool, error) {
	value = strings.ToLower(strings.Trim(value, " "))
	if value == "" {
		return defaultValue, nil
	}

	return strconv.ParseBool(value)
}
761654
func (a *Attribute) GetBool() (value bool, ok bool) {
	if a.Bool == nil {
		return false, false
	}

	return *a.Bool, true
}
388538
func (s *Session) GetBool(key string) bool {
	r, _ := s.Get(key).(bool)
	return r
}