Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 4d224bd

Browse files
committed
internal/fs: more nits
Signed-off-by: Ibrahim AshShohail <[email protected]>
1 parent e568774 commit 4d224bd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

internal/fs/fs.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,11 @@ func copySymlink(src, dst string) error {
296296
}
297297

298298
err = os.Symlink(resolved, dst)
299+
if err != nil {
300+
return errors.Wrapf(err, "failed to create symlink %s to %s", src, resolved)
301+
}
299302

300-
return errors.Wrapf(err, "failed to create symlink %s to %s", src, resolved)
303+
return nil
301304
}
302305

303306
// IsDir determines is the path given is a directory or not.

internal/fs/fs_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,8 +820,7 @@ func TestIsSymlink(t *testing.T) {
820820
}
821821

822822
inaccessibleSymlink = filepath.Join(dir, "symlink")
823-
err = os.Symlink(inaccessibleFile, inaccessibleSymlink)
824-
return err
823+
return os.Symlink(inaccessibleFile, inaccessibleSymlink)
825824
})
826825
defer cleanup()
827826
if err != nil {

0 commit comments

Comments
 (0)