From 79793a895189f97e2423eb42940edf885b869e64 Mon Sep 17 00:00:00 2001 From: Ole Morud Date: Fri, 26 May 2023 23:40:01 +0200 Subject: [PATCH] Add unused utility function --- util.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util.go b/util.go index 646f96e..0b704db 100644 --- a/util.go +++ b/util.go @@ -38,7 +38,12 @@ func ReadEnvFile(path string) (map[string]string, error) { return output, nil } -// Creates a new chat session id and saves it to a file -func NewChat(path string) { +func Contains[T comparable](haystack []T, needle T) bool { + for _, v := range haystack { + if v == needle { + return true + } + } + return false }