func Find(a []string, x string) int {
	for i, n := range a {
		if x == n {
			return i
		}
	}
	return -1
}
Find returns the smallest index i at which x == a[i],
or -1 if there is no such index.
package utils
import (
	"fmt"
	"os"
	"path/filepath"
	"regexp"
	"sort"
	"strings"
)
var (
	headerRegexp        = regexp.MustCompile(`\.(h|hpp|inc)$`)
	compileSourceRegexp = regexp.MustCompile(`\.(c|s|cpp|cc|S)$`)
)
func IsHeader(s string) bool {
	return headerRegexp.MatchString(s)
}
func IsNotHeader(s string) bool {
	return !headerRegexp.MatchString(s)
}
func IsCompilableSource(s string) bool {
	return compileSourceRegexp.MatchString(s)
}
func IsNotCompilableSource(s string) bool {
	return !compileSourceRegexp.MatchString(s)
}
func PrefixAll(list []string, prefix string) []string {
	output := []string{}
	for _, s := range list {
		output = append(output, prefix+s)
	}
	return output
}
func PrefixDirs(paths []string, dir string) []string {
	output := []string{}
	for _, p := range paths {
		output = append(output, filepath.Join(dir, p))
	}
	return output
}
func SortedKeys(m map[string]string) []string {
	keys := make([]string, len(m))
	i := 0
	for key := range m {
		keys[i] = key
		i++
	}
	sort.Strings(keys)
	return keys
}
func SortedKeysBoolMap(m map[string]bool) []string {
	keys := make([]string, len(m))
	i := 0
	for key := range m {
		keys[i] = key
		i++
	}
	sort.Strings(keys)
	return keys
}
func SortedKeysByteSlice(m map[string][]byte) []string {
	keys := make([]string, len(m))
	i := 0
	for key := range m {
		keys[i] = key
		i++
	}
	sort.Strings(keys)
	return keys
}
func Contains(list []string, x string) bool {
	for _, y := range list {
		if y == x {
			return true
		}
	}
	return false
}
func ListsContain(x string, lists ...[]string) bool {
	for _, list := range lists {
		if Contains(list, x) {
			return true
		}
	}
	return false
}
func Filter(predicate func(string) bool, lists ...[]string) (ret []string) {
	for _, list := range lists {
		for _, s := range list {
			if predicate(s) {
				ret = append(ret, s)
			}
		}
	}
	return
}
func Difference(s []string, t []string) []string {
	var diff []string
	for _, element := range s {
		if !Contains(t, element) {
			diff = append(diff, element)
		}
	}
	return diff
}
func AppendIfUnique(destination []string, value string) []string {
	if !Contains(destination, value) {
		return append(destination, value)
	}
	return destination
}
func AppendUnique(destination []string, source []string) []string {
	if len(source) < 1 {
		return destination
	}
	output := make([]string, len(destination))
	copy(output, destination)
	for _, value := range source {
		output = AppendIfUnique(output, value)
	}
	return output
}