diff --git a/support/slice/helpers.go b/support/slice/helpers.go index 183016a..c85c74b 100644 --- a/support/slice/helpers.go +++ b/support/slice/helpers.go @@ -6,13 +6,12 @@ import ( // Contains Check item in slice string type func Contains(slice []string, item string) bool { - set := make(map[string]struct{}, len(slice)) for _, s := range slice { - set[s] = struct{}{} + if s == item { + return true + } } - - _, ok := set[item] - return ok + return false } // ContainsRune Check item in map rune type