(submitPaths []string)
| 174 | } |
| 175 | |
| 176 | func (s *submitCmdContext) removeDuplicatePaths(submitPaths []string) []string { |
| 177 | seen := make(map[string]bool) |
| 178 | result := make([]string, 0, len(submitPaths)) |
| 179 | |
| 180 | for _, val := range submitPaths { |
| 181 | if _, ok := seen[val]; !ok { |
| 182 | seen[val] = true |
| 183 | result = append(result, val) |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | return result |
| 188 | } |
| 189 | |
| 190 | // exercise creates an exercise using one of the submitted filepaths. |
| 191 | // This assumes prior verification that submit paths belong to the same exercise. |