summaryrefslogtreecommitdiff
path: root/utils.go
diff options
context:
space:
mode:
authorMarkus Krogh <markus@nordu.net>2018-06-08 08:01:06 +0200
committerMarkus Krogh <markus@nordu.net>2018-06-08 08:01:06 +0200
commitfc2455cdbf8c64c98a8f7104ae7e7acdcff1337c (patch)
treea80e94c6bbe7fbd768379dd940a269ae0920e744 /utils.go
parent16fe3880782e38a1adaa157f26b788049bcc3205 (diff)
Go impl of pwman, first draft
Diffstat (limited to 'utils.go')
-rw-r--r--utils.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/utils.go b/utils.go
new file mode 100644
index 0000000..6379beb
--- /dev/null
+++ b/utils.go
@@ -0,0 +1,18 @@
+package main
+
+func first(list []string) string {
+ if len(list) > 0 {
+ return list[0]
+ } else {
+ return ""
+ }
+}
+
+func contains(list []string, what string) bool {
+ for _, value := range list {
+ if value == what {
+ return true
+ }
+ }
+ return false
+}