summaryrefslogtreecommitdiff
path: root/utils.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2018-10-25 03:54:43 +0200
committerNikolaus Gotsche <n@softwarefools.com>2018-10-25 03:54:43 +0200
commit25e12980c0448cb58e545fffa137905fd861dea3 (patch)
treef93ee9c04f5a627283f5c75555dd4a6dd0c68f9c /utils.go
parent261d250f50b17117e99ab8b4b6ac7dfd35371386 (diff)
Resume now fully functional0.3.3
Diffstat (limited to 'utils.go')
-rw-r--r--utils.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/utils.go b/utils.go
index ae52f44..f35a5a4 100644
--- a/utils.go
+++ b/utils.go
@@ -248,3 +248,32 @@ func sumFloatArray(in []float64) (sum float64) {
}
return
}
+
+func isElement(some int, group []int) bool {
+ for _, e := range group {
+ if e == some {
+ return true
+ }
+ }
+ return false
+}
+
+func removeItems(master, rem []int) []int {
+ var out []int
+ for _, v := range master {
+ if !isElement(v, rem) {
+ out = append(out, v)
+ }
+ }
+ return out
+}
+
+func IsStrElement(some string, group []string) bool {
+ for _, e := range group {
+ if e == some {
+ return true
+ }
+ }
+ return false
+}
+