You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This returned value is broken as /tmp is actually a symlink. I would expect the method to return an error because the docs say "An error is returned if targpath can't be made relative to basepath"
The text was updated successfully, but these errors were encountered:
mfbx9da4
changed the title
path/filepath: Rel is not throwing an error for symlinks
path/filepath: Rel is not returning an error for symlinks
Mar 31, 2024
By design, Rel is a purely lexical operation. It doesn't interact with the file system, so it cannot tell nor does it care that some path segments are symbolic links. It fails only when called on arguments such as ("..", ".") or ("/a", "a"), where the answer would depend on os.Getwd, or ("C:\foo", "D:\bar"), as there is no relative path that spans Windows volumes.
Go version
go version go1.22.1 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
This returned value is broken as
/tmp
is actually a symlink. I would expect the method to return an error because the docs say "An error is returned if targpath can't be made relative to basepath"What did you see happen?
See above
What did you expect to see?
See above
The text was updated successfully, but these errors were encountered: