diff options
Diffstat (limited to 'middleware/pkg/strings/slice.go')
-rw-r--r-- | middleware/pkg/strings/slice.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/middleware/pkg/strings/slice.go b/middleware/pkg/strings/slice.go new file mode 100644 index 000000000..3d4b1d481 --- /dev/null +++ b/middleware/pkg/strings/slice.go @@ -0,0 +1,11 @@ +package strings + +// StringInSlice check whether string a is a member of slice. +func StringInSlice(a string, slice []string) bool { + for _, b := range slice { + if b == a { + return true + } + } + return false +} |