(input []string)
| 1 | package unique |
| 2 | |
| 3 | func StringSlice(input []string) []string { |
| 4 | result := make([]string, 0, len(input)) |
| 5 | seen := make(map[string]struct{}) |
| 6 | for _, v := range input { |
| 7 | if _, ok := seen[v]; !ok { |
| 8 | result = append(result, v) |
| 9 | seen[v] = struct{}{} |
| 10 | } |
| 11 | } |
| 12 | return result |
| 13 | } |
no outgoing calls
no test coverage detected