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

x/sys/execabs: Incorrect error reported when executable does not exist #58606

Closed
DavidBuchanan314 opened this issue Feb 20, 2023 · 1 comment
Closed
Assignees
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@DavidBuchanan314
Copy link

DavidBuchanan314 commented Feb 20, 2023

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

Go 1.20, via https://go.dev/play/

Does this issue reproduce with the latest release?

Yes

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

https://go.dev/play/

What did you do?

package main

import (
	"fmt"

	"golang.org/x/sys/execabs"
)

func main() {
	fmt.Println(execabs.Command("this-command-does-not-exist").Start())
}

What did you expect to see?

An error message should complain that the executable was not found in the current PATH, or something along those lines. The os/exec equivalent code returns this error:

exec: "this-command-does-not-exist": executable file not found in $PATH

What did you see instead?

The error reported is:

this-command-does-not-exist resolves to executable in current directory (./this-command-does-not-exist)

(This is not true, there is no such file in the current directory)

@gopherbot gopherbot added this to the Unreleased milestone Feb 20, 2023
@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Feb 20, 2023
@ianlancetaylor ianlancetaylor self-assigned this Feb 20, 2023
@gopherbot
Copy link

Change https://go.dev/cl/469735 mentions this issue: execabs: don't override Go 1.19 error with our error

@golang golang locked and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants