summaryrefslogtreecommitdiff
path: root/pkg/utils/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/utils/main.go')
-rw-r--r--pkg/utils/main.go24
1 files changed, 24 insertions, 0 deletions
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
+}