Skip to content

Commit 89d7939

Browse files
committed
use real version instead of spec
1 parent 2e7414f commit 89d7939

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

dist/setup/index.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -63602,19 +63602,18 @@ function run() {
6360263602
core.debug(`add bin ${added}`);
6360363603
core.info(`Successfully set up Go version ${versionSpec}`);
6360463604
}
63605+
let goPath = yield io.which('go');
63606+
let goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString();
6360563607
if (cache && cache_utils_1.isCacheFeatureAvailable()) {
6360663608
const packageManager = 'default';
6360763609
const cacheDependencyPath = core.getInput('cache-dependency-path');
63608-
let goPath = yield io.which('go');
63609-
core.info(`Version spec is ${versionSpec}, go path is ${goPath}`);
63610-
yield cache_restore_1.restoreCache(versionSpec, packageManager, cacheDependencyPath);
63610+
core.info(`Version spec is ${versionSpec}, go version is ${goVersion}`);
63611+
yield cache_restore_1.restoreCache(goVersion, packageManager, cacheDependencyPath);
6361163612
}
6361263613
// add problem matchers
6361363614
const matchersPath = path_1.default.join(__dirname, '../..', 'matchers.json');
6361463615
core.info(`##[add-matcher]${matchersPath}`);
6361563616
// output the version actually being used
63616-
let goPath = yield io.which('go');
63617-
let goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString();
6361863617
core.info(goVersion);
6361963618
core.setOutput('go-version', parseGoVersion(goVersion));
6362063619
core.startGroup('go env');

src/main.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,21 @@ export async function run() {
5656
core.info(`Successfully set up Go version ${versionSpec}`);
5757
}
5858

59+
let goPath = await io.which('go');
60+
let goVersion = (cp.execSync(`${goPath} version`) || '').toString();
61+
5962
if (cache && isCacheFeatureAvailable()) {
6063
const packageManager = 'default';
6164
const cacheDependencyPath = core.getInput('cache-dependency-path');
62-
let goPath = await io.which('go');
63-
core.info(`Version spec is ${versionSpec}, go path is ${goPath}`)
64-
await restoreCache(versionSpec, packageManager, cacheDependencyPath);
65+
core.info(`Version spec is ${versionSpec}, go version is ${goVersion}`)
66+
await restoreCache(goVersion, packageManager, cacheDependencyPath);
6567
}
6668

6769
// add problem matchers
6870
const matchersPath = path.join(__dirname, '../..', 'matchers.json');
6971
core.info(`##[add-matcher]${matchersPath}`);
7072

7173
// output the version actually being used
72-
let goPath = await io.which('go');
73-
let goVersion = (cp.execSync(`${goPath} version`) || '').toString();
7474
core.info(goVersion);
7575

7676
core.setOutput('go-version', parseGoVersion(goVersion));

0 commit comments

Comments
 (0)