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
That's how os.Stat works: it reports information about the target of the symlink. If the target does not exist, that is what it reports. If you want information about the symlink itself, you have to use os.Lstat, as @ZekeLu suggests.
This is consistent with the C functions stat and `lstat.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputTo reproduce:
os
I made a program that does this: https://go.dev/play/p/pCoJBeM6-rC
Code
What did you expect to see?
That
os
says the symlink exists (even if the file it points to doesn't).What did you see instead?
An error that the symlink does not exist.
The text was updated successfully, but these errors were encountered: