Skip to content

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

@DavidBuchanan314

Description

@DavidBuchanan314

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)

Metadata

Metadata

Labels

FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions