Skip to content

Commit 262468e

Browse files
only needed to do once
1 parent 4e8106c commit 262468e

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

dist/index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,8 +1294,6 @@ function run() {
12941294
// since getting unstable versions should be explicit
12951295
let stable = (core.getInput('stable') || 'true').toUpperCase() === 'TRUE';
12961296
console.log(`Setup go ${stable ? 'stable' : ''} version spec ${versionSpec}`);
1297-
// if there's a globally install go and bin path, prefer that
1298-
let addedBin = addBinToPath();
12991297
if (versionSpec) {
13001298
let installDir = tc.find('go', versionSpec);
13011299
if (!installDir) {
@@ -1307,11 +1305,8 @@ function run() {
13071305
core.exportVariable('GOROOT', installDir);
13081306
core.addPath(path.join(installDir, 'bin'));
13091307
console.log('Added go to the path');
1310-
// if the global installed bin wasn't added,
1311-
// we can add the bin just installed
1312-
if (!addedBin) {
1313-
addBinToPath();
1314-
}
1308+
let added = addBinToPath();
1309+
core.debug(`add bin ${added}`);
13151310
}
13161311
else {
13171312
throw new Error(`Could not find a version that satisfied version spec: ${versionSpec}`);

src/main.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ export async function run() {
2222
`Setup go ${stable ? 'stable' : ''} version spec ${versionSpec}`
2323
);
2424

25-
// if there's a globally install go and bin path, prefer that
26-
let addedBin = addBinToPath();
2725
if (versionSpec) {
2826
let installDir: string | undefined = tc.find('go', versionSpec);
2927

@@ -40,11 +38,8 @@ export async function run() {
4038
core.addPath(path.join(installDir, 'bin'));
4139
console.log('Added go to the path');
4240

43-
// if the global installed bin wasn't added,
44-
// we can add the bin just installed
45-
if (!addedBin) {
46-
addBinToPath();
47-
}
41+
let added = addBinToPath();
42+
core.debug(`add bin ${added}`);
4843
} else {
4944
throw new Error(
5045
`Could not find a version that satisfied version spec: ${versionSpec}`

0 commit comments

Comments
 (0)