// StringToSlice is similar to NewSlice, but can be called with
// a Go string type. This exists to make testing integration
// with Gorocksdb easier.
199531
func StringToSlice(data string) *Slice {
	return NewSlice(C.CString(data), C.size_t(len(data)))
}
753454
func ValidateSlice(target []string, valid []string) (bool, error) {
	for _, item := range target {
		found, _ := ValidateString(item, valid)
		if !found {
			return false, fmt.Errorf("'%s' is not in the allowed list: %s", item, strings.Join(valid, ", "))
		}
	}

	return true, nil
}
39117
func IsSliceContainsStr(sl []string, str string) bool {
	str = strings.ToLower(str)
	for _, s := range sl {
		if strings.ToLower(s) == str {
			return true
		}
	}
	return false
}
927304
func StringSlice(s Interface) []string {
	slice := make([]string, 0)
	for _, item := range s.List() {
		v, ok := item.(string)
		if !ok {
			continue
		}

		slice = append(slice, v)
	}
	return slice
}
622999
func (h Hash) StringSlice(key string) []string {
	if value, ok := h[key]; ok {
		return value.StringSlice()
	}
	return []string{}
}
614287
func (t *StringSliceFlag) StringSlice() []string {
	if t.viper == nil || t.value == nil {
		panic(ErrFlagNotYetBind1.New(nil, t.Name))
	}
	return *t.value
}
1349326
func padByteSlice(slice []byte, length int) []byte {
	offset := length - len(slice)
	if offset <= 0 {
		return slice
	}
	newSlice := make([]byte, length)
	copy(newSlice[offset:], slice)
	return newSlice
}
1075950
func (i *Iter) returnSlice(a, b int) []byte {
	if i.rb.src.bytes == nil {
		return i.buf[:copy(i.buf[:], i.rb.src.str[a:b])]
	}
	return i.rb.src.bytes[a:b]
}
494446
func stringSlicetoStringPointerSlice(s []string) []*string {
	o := []*string{}
	for _, str := range s {
		nstr := str
		o = append(o, &nstr)
	}
	return o
}
634214
func (ns *Namespace) IsSlice(v interface{}) bool {
	return reflect.ValueOf(v).Kind() == reflect.Slice
}
426786
func InSlice(slice []string, s string) bool {
	for _, ss := range slice {
		if strings.ToLower(s) == strings.ToLower(ss) {
			return true
		}
	}
	return false
}
698725
func NewStringSliceFlag(fl cli.StringSliceFlag) *StringSliceFlag {
	return &StringSliceFlag{StringSliceFlag: fl, set: nil}
}
931560
func (as AnnotatedSentence) StringSlice() []string {
	retVal := make([]string, len(as), len(as))
	for i, a := range as {
		retVal[i] = a.Value
	}
	return retVal
}
1261803
func FileSlice(name string, files *Files, predicates ...Predicate) Param {
	return func(r *http.Request) error {
		err := r.ParseMultipartForm(maxMemoryBytes)
		if err != nil {
			return err
		}
		if r.MultipartForm == nil && r.MultipartForm.File == nil {
			return fmt.Errorf("missing form")
		}
		for _, p := range predicates {
			if err := p.Pass(name, r); err != nil {
				return err
			}
		}

		fhs := r.MultipartForm.File[name]
		if len(fhs) == 0 {
			*files = []*FileWrapper{}
			return nil
		}

		*files = make([]*FileWrapper, len(fhs))
		for i, fh := range fhs {
			f, err := fh.Open()
			if err != nil {
				files.Close()
				return err
			}
			(*files)[i] = &FileWrapper{f, fh.Filename}
		}
		return nil
	}
}
516046
func indexStringInSlice(s []string, what string) int {
	for i := range s {
		if s[i] == what {
			return i
		}
	}
	return -1
}
808836
func (fsm *MapInputSource) StringSlice(name string) ([]string, error) {
	otherGenericValue, exists := fsm.valueMap[name]
	if !exists {
		otherGenericValue, exists = nestedVal(name, fsm.valueMap)
		if !exists {
			return nil, nil
		}
	}

	otherValue, isType := otherGenericValue.([]interface{})
	if !isType {
		return nil, incorrectTypeForFlagError(name, "[]interface{}", otherGenericValue)
	}

	var stringSlice = make([]string, 0, len(otherValue))
	for i, v := range otherValue {
		stringValue, isType := v.(string)

		if !isType {
			return nil, incorrectTypeForFlagError(fmt.Sprintf("%s[%d]", name, i), "string", v)
		}

		stringSlice = append(stringSlice, stringValue)
	}

	return stringSlice, nil
}
618317
func StringSliceReverse(in []string) (out []string) {
	for i := len(in) - 1; i >= 0; i-- {
		out = append(out, in[i])
	}
	return
}