| 661 | var ErrDepthExceeded = errors.New("ssh_config: max recurse depth exceeded") |
| 662 | |
| 663 | func removeDups(arr []string) []string { |
| 664 | // Use map to record duplicates as we find them. |
| 665 | encountered := make(map[string]bool, len(arr)) |
| 666 | result := make([]string, 0) |
| 667 | |
| 668 | for v := range arr { |
| 669 | //lint:ignore S1002 I prefer it this way |
| 670 | if encountered[arr[v]] == false { |
| 671 | encountered[arr[v]] = true |
| 672 | result = append(result, arr[v]) |
| 673 | } |
| 674 | } |
| 675 | return result |
| 676 | } |
| 677 | |
| 678 | // NewInclude creates a new Include with a list of file globs to include. |
| 679 | // Configuration files are parsed greedily (e.g. as soon as this function runs). |