From 48cfb521d12193f552079f394cdef35f1911212f Mon Sep 17 00:00:00 2001 From: erik Date: Thu, 21 Dec 2023 14:22:42 +0100 Subject: [PATCH] Add suffix checking helper --- modules/validation/helpers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/validation/helpers.go b/modules/validation/helpers.go index cc3c40bd15..032c996fb5 100644 --- a/modules/validation/helpers.go +++ b/modules/validation/helpers.go @@ -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) +}