Skip to content

os/exec: LookPath uses a hard coded "/", assuming this is broken on Windows #60680

@martinrode

Description

@martinrode

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

$ go version
go version go1.20.4 darwin/arm64

Does this issue reproduce with the latest release?

Yes

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

My assumption here is that os.LookPath will not work the same on Windows as it does on Linux / Mac. It will try to check the PATH environment even if the prog passed is utils\myprog.exe.

What did you do?

Read through the source code of LookPath.

What did you expect to see?

Something like filepath.Separator used instead of /.

What did you see instead?

A /

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-WindowsWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions