This repository was archived by the owner on Jul 15, 2023. It is now read-only.
Description On MSYS2, Go binary is not located under ${GOROOT}/bin thus getGoRuntimePath() in goPath.ts failed to locate go.exe. Example go env output in MSYS2:
GOROOT=<installation directory>\mingw64\lib\go
GOTOOLDIR=<installation directory>\mingw64\lib\go\pkg\tool\windows_amd64
//Go binary at (accessible through ${PATH})
<installation directory>\mingw64\bin
where <installation directory> is the directory where I installed MSYS2. Currently I fix this issue by changing goPath.ts line 79-84
if (process.env['GOROOT']) {
runtimePathCache = path.join(process.env['GOROOT'], 'bin', correctBinNameGo);
} else if (process.env['PATH']) {
let pathparts = (<string>process.env.PATH).split(path.delimiter);
runtimePathCache = pathparts.map(dir => path.join(dir, correctBinNameGo)).filter(candidate => fileExists(candidate))[0];
}
to
if (process.env['GOROOT']) {
runtimePathCache = path.join(process.env['GOROOT'], 'bin', correctBinNameGo);
if (!fileExists(runtimePathCache))
runtimePathCache = null;
}
if (!runtimePathCache && process.env['PATH']) {
let pathparts = (<string>process.env.PATH).split(path.delimiter);
runtimePathCache = pathparts.map(dir => path.join(dir, correctBinNameGo)).filter(candidate => fileExists(candidate))[0];
}
Reactions are currently unavailable
On MSYS2, Go binary is not located under
${GOROOT}/binthusgetGoRuntimePath()ingoPath.tsfailed to locatego.exe. Examplego envoutput in MSYS2:where
<installation directory>is the directory where I installed MSYS2. Currently I fix this issue by changinggoPath.tsline 79-84to