remove unnecessary filepath.Join since dest is always an absolute path

This commit is contained in:
Priya Wadhwa 2018-11-19 15:07:56 -05:00
parent 2cf6f52517
commit edd873d1fe
1 changed files with 2 additions and 2 deletions

View File

@ -245,8 +245,8 @@ func extractFile(dest string, hdr *tar.Header, tr io.Reader) error {
return errors.Wrapf(err, "error removing %s to make way for new link", hdr.Name)
}
}
link := filepath.Join(dest, hdr.Linkname)
if err := os.Link(filepath.Clean(filepath.Join("/", link)), path); err != nil {
link := filepath.Clean(filepath.Join(dest, hdr.Linkname))
if err := os.Link(link, path); err != nil {
return err
}