diff options
Diffstat (limited to 'src/path/filepath/symlink.go')
-rw-r--r-- | src/path/filepath/symlink.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/path/filepath/symlink.go b/src/path/filepath/symlink.go index f9435e0d5b..a6047ae444 100644 --- a/src/path/filepath/symlink.go +++ b/src/path/filepath/symlink.go @@ -6,6 +6,7 @@ package filepath import ( "errors" + "internal/filepathlite" "io/fs" "os" "runtime" @@ -13,7 +14,7 @@ import ( ) func walkSymlinks(path string) (string, error) { - volLen := volumeNameLen(path) + volLen := filepathlite.VolumeNameLen(path) pathSeparator := string(os.PathSeparator) if volLen < len(path) && os.IsPathSeparator(path[volLen]) { @@ -34,7 +35,7 @@ func walkSymlinks(path string) (string, error) { // On Windows, "." can be a symlink. // We look it up, and use the value if it is absolute. // If not, we just return ".". - isWindowsDot := runtime.GOOS == "windows" && path[volumeNameLen(path):] == "." + isWindowsDot := runtime.GOOS == "windows" && path[filepathlite.VolumeNameLen(path):] == "." // The next path component is in path[start:end]. if end == start { @@ -73,7 +74,7 @@ func walkSymlinks(path string) (string, error) { // Ordinary path component. Add it to result. - if len(dest) > volumeNameLen(dest) && !os.IsPathSeparator(dest[len(dest)-1]) { + if len(dest) > filepathlite.VolumeNameLen(dest) && !os.IsPathSeparator(dest[len(dest)-1]) { dest += pathSeparator } @@ -113,7 +114,7 @@ func walkSymlinks(path string) (string, error) { path = link + path[end:] - v := volumeNameLen(link) + v := filepathlite.VolumeNameLen(link) if v > 0 { // Symlink to drive name is an absolute path. if v < len(link) && os.IsPathSeparator(link[v]) { |