// SQLScanStringSlice set obj to value's stringslice representation
347494
func SQLScanStringSlice(obj interface{}, value interface{}) (err error) {
	if value == nil {
		return
	}

	pv, err := ensureScanValue(obj)
	if err != nil {
		return
	}

	switch value.(type) {
	case []byte:
		stringslice := parseArray(string(value.([]byte)))
		pv.Set(reflect.ValueOf(stringslice))
		return
	case string:
		stringslice := parseArray(value.(string))
		pv.Set(reflect.ValueOf(stringslice))
		return
	default:
		return ErrorUnsupportedScanType1.New(nil, value)
	}
}
626932
func MustStringSlice(input interface{}) []string {
	output, err := StringSlice(input)
	if err != nil {
		panic(err)
	}
	return output
}
1246389
func StringSlice(value []string, name, usage string) *[]string {
	p := new([]string)
	flag.Var(NewStringSlice(value, p), name, usage)
	return p
}
614287
func (t *StringSliceFlag) StringSlice() []string {
	if t.viper == nil || t.value == nil {
		panic(ErrFlagNotYetBind1.New(nil, t.Name))
	}
	return *t.value
}
121563
func indexOfStringSlice(strings []string, s string) int {
	for i, b := range strings {
		if b == s {
			return i
		}
	}
	return -1
}
1056031
func (t SQLStringSlice) Value() (value driver.Value, err error) {
	return SQLValueStringSlice(t)
}
516046
func indexStringInSlice(s []string, what string) int {
	for i := range s {
		if s[i] == what {
			return i
		}
	}
	return -1
}
857606
func SQLScanEnumString(obj interface{}, value interface{}, stringMapEnum map[string]interface{}) (err error) {
	if value == nil {
		return
	}

	pv, err := ensureScanValue(obj)
	if err != nil {
		return
	}

	var enumstr string
	switch value.(type) {
	case []byte:
		enumstr = string(value.([]byte))
	case string:
		enumstr = value.(string)
	default:
		return ErrorUnsupportedScanType1.New(nil, value)
	}

	enumval, ok := stringMapEnum[enumstr]
	if !ok {
		return ErrorNoValueFound1.New(nil, value)
	}
	ev := reflect.ValueOf(enumval)
	pv.Set(ev)
	return
}
681223
func (t ListType) ConvertToStringSlice(value interface{}) ([]string, error) {
	if value == nil {
		return []string{}, nil
	}
	valueList, err := ConvertList(func(fieldType FieldType, value interface{}) (interface{}, error) {
		return fieldType.ConvertToStringSlice(value)
	}, t.ComponentType, value)
	if err != nil {
		return nil, errs.Wrapf(err, "failed to convert list type to string slice")
	}
	if (len(valueList)) == 0 {
		return []string{}, nil
	}
	buffer := make([]string, len(valueList))
	for i := range valueList {
		strValueList := valueList[i].([]string)
		if len(strValueList) != 1 {
			return nil, errs.Errorf("string conversion of base type did not return exactly one value")
		}
		buffer[i] = strValueList[0]
	}
	return buffer, nil
}
320629
func (session *Session) QuerySliceString(sqlorArgs ...interface{}) ([][]string, error) {
	if session.isAutoClose {
		defer session.Close()
	}

	sqlStr, args, err := session.genQuerySQL(sqlorArgs...)
	if err != nil {
		return nil, err
	}

	rows, err := session.queryRows(sqlStr, args...)
	if err != nil {
		return nil, err
	}
	defer rows.Close()

	return rows2SliceString(rows)
}
59916
func (r *Rows) ScanMap(a NullStringMap) error {
	cols, _ := r.Columns()
	var refs []interface{}
	for i := 0; i < len(cols); i++ {
		var t sql.NullString
		refs = append(refs, &t)
	}
	if err := r.Scan(refs...); err != nil {
		return err
	}

	for i, col := range cols {
		a[col] = *refs[i].(*sql.NullString)
	}

	return nil
}
344646
func (mmap MarshalMap) Int64Slice(key string) ([]int64, error) {
	return mmap.Int64Array(key)
}
270600
func StringSlice(val, sep string) ([]string, error) {
	return strings.Split(val, sep), nil
}
620667
func ParseSqlSelect(sqlQuery string) (*SqlSelect, error) {
	stmt, err := ParseSql(sqlQuery)
	if err != nil {
		return nil, err
	}
	sel, ok := stmt.(*SqlSelect)
	if !ok {
		return nil, fmt.Errorf("Expected SqlSelect but got %T", stmt)
	}
	return sel, nil
}
1101071
func (t EnumType) ConvertToStringSlice(value interface{}) ([]string, error) {
	if value != nil && !contains(t.Values, value) {
		return nil, errs.Errorf("value: %+v (%[1]T) is not part of allowed enum values: %+v", value, t.Values)
	}
	converted, err := t.BaseType.ConvertToStringSlice(value)
	if err != nil {
		return nil, errs.Wrapf(err, "failed to convert enum value to string slice: %+v", value)
	}
	return converted, nil
}
102289
func (schema *Schema) arrayOfStringsValue(v interface{}) *[]string {
	switch v := v.(type) {
	default:
		fmt.Printf("arrayOfStringsValue: unexpected type %T\n", v)
	case []string:
		return &v
	case string:
		a := []string{v}
		return &a
	case []interface{}:
		a := make([]string, 0)
		for _, v2 := range v {
			switch v2 := v2.(type) {
			default:
				fmt.Printf("arrayOfStringsValue: unexpected type %T\n", v2)
			case string:
				a = append(a, v2)
			}
		}
		return &a
	}
	return nil
}
935989
func IntSlice(s Interface) []int {
	slice := make([]int, 0)
	for _, item := range s.List() {
		v, ok := item.(int)
		if !ok {
			continue
		}

		slice = append(slice, v)
	}
	return slice
}