// Int32ValueSlice converts a slice of int32 pointers into a slice of
// int32 values
420724
func Int32ValueSlice(src []*int32) []int32 {
	dst := make([]int32, len(src))
	for i := 0; i < len(src); i++ {
		if src[i] != nil {
			dst[i] = *(src[i])
		}
	}
	return dst
}
1026986
func Int64Value(val string) (*wrappers.Int64Value, error) {
	parsedVal, err := Int64(val)
	return &wrappers.Int64Value{Value: parsedVal}, err
}
343749
func Convert_Slice_string_To_Slice_int32(in *[]string, out *[]int32, s conversion.Scope) error {
	for _, s := range *in {
		for _, v := range strings.Split(s, ",") {
			x, err := strconv.ParseUint(v, 10, 16)
			if err != nil {
				return fmt.Errorf("cannot convert to []int32: %v", err)
			}
			*out = append(*out, int32(x))
		}
	}
	return nil
}
965090
func StringToInt32Slice(s, sep string) []int32 {
	if s == "" {
		return nil
	}

	fields := strings.Split(s, sep)
	slice := make([]int32, len(fields))
	for i, f := range fields {
		slice[i] = ToInt32(f)
	}
	return slice
}
486109
func decodeSlice(elemType reflect.Type, slice reflect.Value, input map[string]interface{}) error {
	var v reflect.Value
	if elemType.Kind() == reflect.Ptr {
		v = reflect.New(elemType.Elem())
	} else {
		v = reflect.New(elemType)
	}

	if !v.CanInterface() {
		return fmt.Errorf("can't interface %#v", v)
	}

	if err := decodeMap(input, v.Interface()); err != nil {
		return err
	}

	if elemType.Kind() == reflect.Struct {
		v = v.Elem()
	}
	slice.Set(reflect.Append(slice, v))

	return nil
}
1198088
func Float64ValueSlice(src []*float64) []float64 {
	dst := make([]float64, len(src))
	for i := 0; i < len(src); i++ {
		if src[i] != nil {
			dst[i] = *(src[i])
		}
	}
	return dst
}
984680
func (me *DefaultAdapter) SliceValueSql(buf *SqlBuilder, slice reflect.Value) error {
	buf.WriteRune(left_paren_rune)
	for i, l := 0, slice.Len(); i < l; i++ {
		if err := me.Literal(buf, slice.Index(i).Interface()); err != nil {
			return err
		}
		if i < l-1 {
			buf.WriteRune(comma_rune)
			buf.WriteRune(space_rune)
		}
	}
	buf.WriteRune(right_paren_rune)
	return nil
}
762480
func Int32(v int32) *int32 {
	p := new(int32)
	*p = v
	return p
}
737487
func Int32Bytes(v int32) []byte {
	b := make([]byte, 4)
	PutInt32(b, v)
	return b
}
982794
func Int32s(b0, b1 []int32) int {
	d := 0
	for i, x := range b0 {
		d += Int32(x, b1[i])
	}
	return d
}
380360
func (v *Value) ObjxMapSlice(optionalDefault ...[](Map)) [](Map) {
	if s, ok := v.data.([]Map); ok {
		return s
	}

	if s, ok := v.data.([]map[string]interface{}); ok {
		result := make([]Map, len(s))
		for i := range s {
			result[i] = s[i]
		}
		return result
	}

	s, ok := v.data.([]interface{})
	if !ok {
		if len(optionalDefault) == 1 {
			return optionalDefault[0]
		}
		return nil
	}

	result := make([]Map, len(s))
	for i := range s {
		switch s[i].(type) {
		case Map:
			result[i] = s[i].(Map)
		case map[string]interface{}:
			result[i] = New(s[i])
		default:
			return nil
		}
	}
	return result
}
601286
func InterfaceSlice(slice interface{}) []interface{} {
	s := reflect.ValueOf(slice)
	if s.Kind() != reflect.Slice {
		panic("InterfaceSlice() given a non-slice type")
	}

	ret := make([]interface{}, s.Len())

	for i := 0; i < s.Len(); i++ {
		ret[i] = s.Index(i).Interface()
	}

	return ret
}
1151747
func ContainsInt32(s []int32, v int32) bool {
	for _, vv := range s {
		if vv == v {
			return true
		}
	}
	return false
}
614287
func (t *StringSliceFlag) StringSlice() []string {
	if t.viper == nil || t.value == nil {
		panic(ErrFlagNotYetBind1.New(nil, t.Name))
	}
	return *t.value
}
566350
func int32ToBytes(i int32) []byte {
	buf := make([]byte, 4)
	binary.BigEndian.PutUint32(buf, uint32(i))
	return buf
}
634214
func (ns *Namespace) IsSlice(v interface{}) bool {
	return reflect.ValueOf(v).Kind() == reflect.Slice
}
829158
func IntInSlice(valid []int) schema.SchemaValidateFunc {
	return func(i interface{}, k string) (s []string, es []error) {
		v, ok := i.(int)
		if !ok {
			es = append(es, fmt.Errorf("expected type of %s to be an integer", k))
			return
		}

		for _, validInt := range valid {
			if v == validInt {
				return
			}
		}

		es = append(es, fmt.Errorf("expected %s to be one of %v, got %d", k, valid, v))
		return
	}
}