//StringInSlice returns a ValidateFunc which tests if the provided version
// is of type string and matches the value of element in the slice
StringInSlice returns a ValidateFunc which tests if the provided version
is of type string and matches the value of element in the slice
// StringInSlice returns a ValidateFunc which tests if the provided version // is of type string and matches the value of element in the slice
func StringInSlice(valid []string, ignoreCase bool) schema.SchemaValidateFunc {
	return func(i interface{}, k string) (s []string, es []error) {
		v, ok := i.(string)
		if !ok {
			es = append(es, fmt.Errorf("expected type of %s to be string", k))
			return
		}
		for _, str := range valid {
			if v == str || (ignoreCase && strings.ToLower(v) == strings.ToLower(str)) {
				return
			}
		}
		es = append(es, fmt.Errorf("expected %s to be one of %v, got %s", k, valid, v))
		return
	}
}
func StringInSlice ( valid [ ] string , ignoreCase bool ) schema . SchemaValidateFunc { return func ( i interface { } , k string ) ( s [ ] string , es [ ] error ) { v , ok := i . ( string ) if ! ok { es = append ( es , fmt . Errorf ( " " , k ) ) return } for _ , str := range valid { if v == str || ( ignoreCase && strings . ToLower ( v ) == strings . ToLower ( str ) ) { return } } es = append ( es , fmt . Errorf ( " " , k , valid , v ) ) return } }
StringInSlice returns a ValidateFunc which tests if the provided version
is of type string and matches the value of element in the slice
StringInSlice returns a ValidateFunc which tests if the provided version is of type string and matches the value of element in the slice