helper/validation: Fix comment on StringMatch
To match the current implementation.
This commit is contained in:
parent
e33aa9dc2e
commit
5da62a44f4
|
@ -107,9 +107,8 @@ func StringLenBetween(min, max int) schema.SchemaValidateFunc {
|
||||||
}
|
}
|
||||||
|
|
||||||
// StringMatch returns a SchemaValidateFunc which tests if the provided value
|
// StringMatch returns a SchemaValidateFunc which tests if the provided value
|
||||||
// matches a given regexp, which must compile or else the function will panic.
|
// matches a given regexp. Optionally an error message can be provided to
|
||||||
// Optionally an error message can be provided to return something friendlier
|
// return something friendlier than "must match some globby regexp".
|
||||||
// than "must match some globby regexp".
|
|
||||||
func StringMatch(r *regexp.Regexp, message string) schema.SchemaValidateFunc {
|
func StringMatch(r *regexp.Regexp, message string) schema.SchemaValidateFunc {
|
||||||
return func(i interface{}, k string) ([]string, []error) {
|
return func(i interface{}, k string) ([]string, []error) {
|
||||||
v, ok := i.(string)
|
v, ok := i.(string)
|
||||||
|
|
Loading…
Reference in New Issue