Add suffix checking helper
This commit is contained in:
parent
c887bddb72
commit
48cfb521d1
1 changed files with 4 additions and 0 deletions
|
@ -151,3 +151,7 @@ func ValidateOneOf(value string, allowed []string) []string {
|
|||
}
|
||||
return []string{fmt.Sprintf("Value %v is not contained in allowed values [%v]", value, allowed)}
|
||||
}
|
||||
|
||||
func ValidateSuffix(str, suffix string) bool {
|
||||
return strings.HasSuffix(str, suffix)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue