keycloak-operator/controllers/helpers.go

23 lines
476 B
Go
Raw Normal View History

2021-01-10 23:49:22 +01:00
package controllers
// Helper functions to check and remove string from a slice of strings.
func containsString(slice []string, s string) bool {
for _, item := range slice {
if item == s {
return true
}
}
return false
}
// Helper functions to check and remove string from a slice of strings.
func removeString(slice []string, s string) (result []string) {
for _, item := range slice {
if item == s {
continue
}
result = append(result, item)
}
return
}