1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// +build linux package chroot func dedupeStringSlice(slice []string) []string { done := make([]string, 0, len(slice)) m := make(map[string]struct{}) for _, s := range slice { if _, present := m[s]; !present { m[s] = struct{}{} done = append(done, s) } } return done }