func appendIfMissing(slice []string, str string) []string {
	for _, ele := range slice {
		if ele == str {
			return slice
		}
	}
	return append(slice, str)
}
AppendIfMissing - Appends a string to a slice if not already present
in slice
package service
import (
	"reflect"
	"regexp"
	"sort"
	log "github.com/sirupsen/logrus"
)
func stringSlicesEqual(a, b []string) bool {
	sort.Strings(a)
	sort.Strings(b)
	if len(a) != len(b) {
		return false
	}
	return reflect.DeepEqual(a, b)
}
func stringSliceRegexMatcher(slice []string, regexpPattern string) []string {
	out := make([]string, 0)
	for _, str := range slice {
		matched, err := regexp.MatchString(regexpPattern, str)
		if err != nil {
			log.Error("Regex: " + regexpPattern + " error: " + err.Error())
			break
		}
		if matched {
			out = append(out, str)
		}
	}
	return out
}
func stringSliceRegexReplace(slice []string, regexpPattern string, replacement string) {
	re := regexp.MustCompile(regexpPattern)
	for i := range slice {
		slice[i] = re.ReplaceAllString(slice[i], replacement)
	}
}