From 2d3c89af288897b599f75605a8580c171dff0000 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Wed, 28 Feb 2018 10:49:01 -0500 Subject: [PATCH] add InSlice --- util/slice.go | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 util/slice.go diff --git a/util/slice.go b/util/slice.go new file mode 100644 index 0000000..0b95200 --- /dev/null +++ b/util/slice.go @@ -0,0 +1,10 @@ +package util + +func InSlice(str string, values []string) bool { + for _, v := range values { + if str == v { + return true + } + } + return false +}