src/goInstallTools: use GOROOT/bin for gocode-gomod build too
This should've been done in cl/263977.
Update golang/vscode-go#757
Change-Id: I51afbc8a2534c1b3f304ba988b6bcec9c944a048
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/264318
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
diff --git a/src/goInstallTools.ts b/src/goInstallTools.ts
index 2e3a06a..26751a9 100644
--- a/src/goInstallTools.ts
+++ b/src/goInstallTools.ts
@@ -241,7 +241,7 @@
// TODO(rstambler): Figure out why this happens and maybe delete it.
if (stderr.indexOf('unexpected directory layout:') > -1) {
- await execFile(goVersion.binaryPath, args, opts);
+ await execFile(goBinary, args, opts);
} else if (hasModSuffix(tool)) {
const gopath = env['GOPATH'];
if (!gopath) {
@@ -249,7 +249,7 @@
}
const destDir = gopath.split(path.delimiter)[0];
const outputFile = path.join(destDir, 'bin', process.platform === 'win32' ? `${tool.name}.exe` : tool.name);
- await execFile(goVersion.binaryPath, ['build', '-o', outputFile, importPath], opts);
+ await execFile(goBinary, ['build', '-o', outputFile, importPath], opts);
}
const toolInstallPath = getBinPath(tool.name);
outputChannel.appendLine(`Installing ${toolImportPath} (${toolInstallPath}) SUCCEEDED`);