From 79d3c2bfd95c5cb0ac6e4a3f97156161d792c676 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Sun, 24 Apr 2022 18:53:32 +0200 Subject: Replace `interface{}` by `any` --- pkg/util/util.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/util') diff --git a/pkg/util/util.go b/pkg/util/util.go index bacb494..cbc6014 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -2,8 +2,8 @@ package util import "time" -// StrContains searches for `needle` in `haystack` and returns `true` if found. -func StrContains(haystack []string, needle string) bool { +// Contains searches for `needle` in `haystack` and returns `true` if found. +func Contains[T comparable](haystack []T, needle T) bool { for _, s := range haystack { if s == needle { return true -- cgit v1.2.3-54-g00ecf