Allow multiple pattern matches for symlinks

Since we allow pattern inputs for locating symlinks we could have
multiples. The error being checked is resolved by the deduplication.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2023-11-17 10:35:07 +01:00
parent 80ecd024ee
commit e609e41a64

View File

@ -117,9 +117,5 @@ func (p symlink) Locate(pattern string) ([]string, error) {
seen[target] = true
targets = append(targets, target)
}
if len(targets) != 1 {
return nil, fmt.Errorf("failed to locate patern %q: %w; failed to uniquely resolve symlink: %v", pattern, errNotFound, candidates)
}
return targets, err
}