Skip to content

Commit d8d4f35

Browse files
committed
symlink: rename variables
Rename cleanP, fullP -> pClean, pFull. This is mostly to silence codespell, which thinks cleanP is a typo in cleanup. Kind of makes sense. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 687c6b3 commit d8d4f35

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

symlink/fs.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ func evalSymlinksInScope(path, root string) (string, error) {
110110
// into "/b/../c" which then gets filepath.Cleaned into "/c" and then
111111
// root gets prepended and we Clean again (to remove any trailing slash
112112
// if the first Clean gave us just "/")
113-
cleanP := filepath.Clean(string(filepath.Separator) + b.String() + p)
114-
if isDriveOrRoot(cleanP) {
113+
pClean := filepath.Clean(string(filepath.Separator) + b.String() + p)
114+
if isDriveOrRoot(pClean) {
115115
// never Lstat "/" itself, or drive letters on Windows
116116
b.Reset()
117117
continue
118118
}
119-
fullP := filepath.Clean(root + cleanP)
119+
pFull := filepath.Clean(root + pClean)
120120

121-
fi, err := os.Lstat(fullP)
121+
fi, err := os.Lstat(pFull)
122122
if os.IsNotExist(err) {
123123
// if p does not exist, accept it
124124
b.WriteString(p)
@@ -135,7 +135,7 @@ func evalSymlinksInScope(path, root string) (string, error) {
135135
}
136136

137137
// it's a symlink, put it at the front of path
138-
dest, err := os.Readlink(fullP)
138+
dest, err := os.Readlink(pFull)
139139
if err != nil {
140140
return "", err
141141
}

0 commit comments

Comments
 (0)