diff --git a/internal/lookup/symlinks.go b/internal/lookup/symlinks.go index aa4c147e..c9bab069 100644 --- a/internal/lookup/symlinks.go +++ b/internal/lookup/symlinks.go @@ -62,6 +62,7 @@ func (p symlinkChain) Locate(pattern string) ([]string, error) { return candidates, nil } + var filenames []string found := make(map[string]bool) for len(candidates) > 0 { candidate := candidates[0] @@ -70,6 +71,7 @@ func (p symlinkChain) Locate(pattern string) ([]string, error) { continue } found[candidate] = true + filenames = append(filenames, candidate) target, err := symlinks.Resolve(candidate) if err != nil { @@ -88,11 +90,6 @@ func (p symlinkChain) Locate(pattern string) ([]string, error) { candidates = append(candidates, target) } } - - var filenames []string - for f := range found { - filenames = append(filenames, f) - } return filenames, nil }