Skip to content

Commit 90da3cf

Browse files
committed
src/goInstallTools.ts: fix parsing version for tools built with GOPATH mode
1 parent 58145f9 commit 90da3cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extension/src/goInstallTools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ async function defaultInspectGoToolVersion(
767767
*/
768768
const lines = stdout.split('\n', 3);
769769
const goVersion = lines[0] && lines[0].match(/\s+(go\d+.\d+\S*)/)?.[1];
770-
const moduleVersion = lines[2].split(/\s+/)[3];
770+
const moduleVersion = lines.length > 2 ? lines[2].split(/\s+/)[3] : "unknown";
771771
return { goVersion, moduleVersion };
772772
} catch (e) {
773773
// either go version failed (e.g. the tool was compiled with a more recent version of go)

0 commit comments

Comments
 (0)