diff --git a/dist/index.js b/dist/index.js index 74206fb87..dd9f2d3c5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2122,7 +2122,7 @@ function addBinToPath() { return added; } let buf = child_process_1.default.execSync('go env GOPATH'); - if (buf) { + if (buf.length > 1) { let gp = buf.toString().trim(); core.debug(`go env GOPATH :${gp}:`); if (!fs_1.default.existsSync(gp)) { diff --git a/src/main.ts b/src/main.ts index a5caf9b94..10232926a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -69,7 +69,7 @@ export async function addBinToPath(): Promise { } let buf = cp.execSync('go env GOPATH'); - if (buf) { + if (buf.length > 1) { let gp = buf.toString().trim(); core.debug(`go env GOPATH :${gp}:`); if (!fs.existsSync(gp)) {