Skip to content
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: Split and Base functions do not handle Windows file paths #51951

Closed
algonzalez opened this issue Mar 25, 2022 · 2 comments
Closed

path: Split and Base functions do not handle Windows file paths #51951

algonzalez opened this issue Mar 25, 2022 · 2 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@algonzalez
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.18 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GOARCH=amd64
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOVERSION=go1.18
set GCCGO=gccgo
set GOAMD64=v1

What did you do?

https://play.golang.com/p/PjD4wd90jdN

What did you expect to see?

path : /tmpfs/me/foo
-> dir : /tmpfs/me/
-> file: foo
-> base: foo
path : \users\me\foo.exe
-> dir : \users\me\
-> file: foo.exe
-> base: foo.exe
path : C:\users\me\foo.exe
-> dir : C:\users\me
-> file: foo.exe
-> base: foo.exe

What did you see instead?

path : /tmpfs/me/foo
-> dir : /tmpfs/me/
-> file: foo
-> base: foo
path : \users\me\foo.exe
-> dir :
-> file: \users\me\foo.exe
-> base: \users\me\foo.exe
path : C:\users\me\foo.exe
-> dir :
-> file: C:\users\me\foo.exe
-> base: C:\users\me\foo.exe

@algonzalez algonzalez changed the title affected/package: path Split and Base functions do not handle windows file paths path: Split and Base functions do not handle windows file paths Mar 25, 2022
@algonzalez algonzalez changed the title path: Split and Base functions do not handle windows file paths path: Split and Base functions do not handle Windows file paths Mar 25, 2022
@mvdan
Copy link
Member

mvdan commented Mar 25, 2022

Are you aware of the filepath package?

@mvdan mvdan added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 25, 2022
@ianlancetaylor
Copy link
Contributor

The path package is for slash separated strings.

The path/filepath package changes behavior based on the operating system it is run on.

Closing because I don't think there is anything to do here. Please comment if you disagree.

@golang golang locked and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants