mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
15 lines
320 B
Go
15 lines
320 B
Go
|
package util
|
||
|
|
||
|
import "strings"
|
||
|
|
||
|
// HasSuffixI returns true if string s has any of the given suffixes, ignoring case.
|
||
|
func HasSuffixI(s string, suffixes ...string) bool {
|
||
|
s = strings.ToLower(s)
|
||
|
for _, suffix := range suffixes {
|
||
|
if strings.HasSuffix(s, strings.ToLower(suffix)) {
|
||
|
return true
|
||
|
}
|
||
|
}
|
||
|
return false
|
||
|
}
|