-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
path: Base is different from file path.Base on windows #71420
Comments
From path's package docs:
IMO the documentation is clear and it already explicitly mentions Windows. What else would you like to see on this docs? |
As noted above, its behavior is clearly documented to be platform independent which is necessary for safely manipulating non filesystem paths like URLs. |
Originally posted by @seankhliao in #49745
@seankhliao and the rest of golang community. How this issue is closed ?
Sure, we have
filepath.Base()
, butpath.Base()
still exists.Either path.Base() should be fixed with correct implementation for windows, or documentation(https://pkg.go.dev/path#Base) should clearly say that its buggy/deprecated/not platform independent.
I spent half by day today debugging an issue on a windows bug on our app, and eventually found it was due to
path.Base()
not working as expected.The text was updated successfully, but these errors were encountered: