func StringSlicesEqual(a []string, b []string) bool {
	if len(a) != len(b) {
		return false
	}
	for k := range a {
		if a[k] != b[k] {
			return false
		}
	}
	return true
}
StringSlicesEqual returns true if slices are equals
package util
import (
	"bufio"
	"fmt"
	"io/ioutil"
	"os"
	"path"
	"regexp"
	"runtime/debug"
	"strconv"
	"strings"
	"time"
	"github.com/golang/glog"
	"github.com/pkg/errors"
)
func JoinStringMap(m map[string]string, exclude map[string]string, sep string) []string {
	res := make([]string, len(m))
	i := 0
	for k, v := range m {
		res[i] = fmt.Sprintf("%s%s%s", k, sep, v)
		i++
	}
	return res
}
func StringSliceToSet(lst []string) map[string]bool {
	res := make(map[string]bool)
	for _, el := range lst {
		res[el] = true
	}
	return res
}
func GetDestFileName(cacheDir string, cluster string, resourceName string) string {
	destDir := path.Join(cacheDir, cluster)
	destFileName := path.Join(destDir, resourceName)
	err := os.MkdirAll(destDir, os.ModePerm)
	FatalIf(err)
	return destFileName
}
func WriteStringToFile(str string, destDir string, resourceName string, suffix string) error {
	err := os.MkdirAll(destDir, os.ModePerm)
	FatalIf(err)
	name := fmt.Sprintf("%s_%s", resourceName, suffix)
	tempPattern := fmt.Sprintf("_%s_%s", resourceName, suffix)
	glog.V(6).Infof("Writing file %s", name)
	tempFile, err := ioutil.TempFile(destDir, tempPattern)
	if err != nil {
		return errors.Wrapf(err, "Error creating temp file in %s for resource %s",
			destDir, name)
	}
	w := bufio.NewWriter(tempFile)
	_, err = w.WriteString(str)
	if err != nil {
		tempFile.Close()
		os.Remove(tempFile.Name())
		return errors.Wrapf(err, "Error writing bytes to file %s",
			tempFile.Name())
	}
	err = w.Flush()
	if err != nil {
		tempFile.Close()
		os.Remove(tempFile.Name())
		return errors.Wrapf(err, "Error flushing buffer")
	}
	err = tempFile.Sync()
	if err != nil {
		tempFile.Close()
		os.Remove(tempFile.Name())
		return errors.Wrapf(err, "Error syncing file")
	}
	err = os.Rename(tempFile.Name(), path.Join(destDir, name))
	if err != nil {
		tempFile.Close()
		os.Remove(tempFile.Name())
		return err
	}
	return nil
}
func JoinSlicesOrNone(sl []string, sep string) string {
	if len(sl) == 0 {
		return "None"
	}
	return strings.Join(sl, sep)
}
func TruncateString(s string, max int) string {
	if len(s) > max {
		return s[:max]
	}
	return s
}
func JoinSlicesWithMaxOrNone(sl []string, max int, sep string) string {
	if len(sl) == 0 {
		return "None"
	}
	if len(sl) < max {
		return strings.Join(sl, sep)
	}
	toDisplay := sl[:max]
	toDisplay = append(toDisplay, "...")
	return strings.Join(toDisplay, sep)
}
func StringMapsEqual(a map[string]string, b map[string]string) bool {
	if len(a) != len(b) {
		return false
	}
	for k := range a {
		if a[k] != b[k] {
			return false
		}
	}
	return true
}