uniquePathsList deduplicates a given slice of strings without sorting or otherwise altering its order in any way.
(paths []string)
| 272 | // uniquePathsList deduplicates a given slice of strings without |
| 273 | // sorting or otherwise altering its order in any way. |
| 274 | func uniquePathsList(paths []string) []string { |
| 275 | seen := map[string]bool{} |
| 276 | newPaths := []string{} |
| 277 | for _, p := range paths { |
| 278 | if seen[p] { |
| 279 | continue |
| 280 | } |
| 281 | seen[p] = true |
| 282 | newPaths = append(newPaths, p) |
| 283 | } |
| 284 | return newPaths |
| 285 | } |
| 286 | |
| 287 | func hasValidPrefix(filepath string, validPrefixes []string) bool { |
| 288 | for _, prefix := range validPrefixes { |
no outgoing calls
no test coverage detected
searching dependent graphs…