Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Directory named 'go' in path results in EACCES error #585

@DonMcNamara

Description

@DonMcNamara

In getBinPathFromEnvVar the code returns the first path that exists, regardless of permission. If that path is a directory named go and not an executable, the code will attempt to execute go version on the directory. This results in: error spawn eacces

Line of code in question: https://github.com/Microsoft/vscode-go/blob/master/src/goPath.ts#L24

Fix: I'm not too familiar with node, but checking the docs, I think this can be fixed by using the fs.accessSync method.

Workaround: Re-order your path, so the go executable is found before the directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions