Differences return the elements in `a` that aren't in `b`
(a, b []string)
| 42 | |
| 43 | // Differences return the elements in `a` that aren't in `b` |
| 44 | func Differences(a, b []string) []string { |
| 45 | mb := make(map[string]bool) |
| 46 | for _, x := range b { |
| 47 | mb[x] = true |
| 48 | } |
| 49 | var diff []string |
| 50 | for _, x := range a { |
| 51 | if _, ok := mb[x]; !ok { |
| 52 | diff = append(diff, x) |
| 53 | } |
| 54 | } |
| 55 | return diff |
| 56 | } |
| 57 | |
| 58 | // ToKebabCase converts a string to kebab case |
| 59 | func ToKebabCase(str string) string { |