From b33be53ea9c0be523988a9412fd8e3f6a24782b3 Mon Sep 17 00:00:00 2001 From: GrailFinder Date: Sat, 20 Apr 2024 07:45:00 +0300 Subject: Feat: add auth [wip] --- pkg/utils/main.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pkg/utils/main.go (limited to 'pkg/utils/main.go') diff --git a/pkg/utils/main.go b/pkg/utils/main.go new file mode 100644 index 0000000..f49313e --- /dev/null +++ b/pkg/utils/main.go @@ -0,0 +1,24 @@ +package utils + +import ( + "strings" + "unicode" +) + +func RemoveSpacesFromStr(origin string) string { + return strings.Map(func(r rune) rune { + if unicode.IsSpace(r) { + return -1 + } + return r + }, origin) +} + +func StrInSlice(key string, sl []string) bool { + for _, i := range sl { + if key == i { + return true + } + } + return false +} -- cgit v1.2.3