Skip to content

Commit ce407cc

Browse files
author
shuai-z
committed
removed redundant Clean
The doc (or src) says: The result is Cleaned. http://golang.org/pkg/path/filepath/#Join Signed-off-by: shuai-z <zs.broccoli@gmail.com>
1 parent 5631ffb commit ce407cc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/symlink/fs.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ func FollowSymlinkInScope(link, root string) (string, error) {
3535

3636
for _, p := range strings.Split(link, "/") {
3737
prev = filepath.Join(prev, p)
38-
prev = filepath.Clean(prev)
3938

4039
loopCounter := 0
4140
for {
@@ -72,7 +71,7 @@ func FollowSymlinkInScope(link, root string) (string, error) {
7271
} else {
7372
prev, _ = filepath.Abs(prev)
7473

75-
if prev = filepath.Clean(filepath.Join(filepath.Dir(prev), dest)); len(prev) < len(root) {
74+
if prev = filepath.Join(filepath.Dir(prev), dest); len(prev) < len(root) {
7675
prev = filepath.Join(root, filepath.Base(dest))
7776
}
7877
}

0 commit comments

Comments
 (0)