mirror of https://github.com/actions/setup-go.git
minor fix
This commit is contained in:
parent
11e0301e1d
commit
5a5cdc8151
|
@ -63236,6 +63236,8 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
|
||||||
manifest = yield getManifest(auth);
|
manifest = yield getManifest(auth);
|
||||||
let stableVersion = yield resolveStableVersionInput(versionSpec, arch, osPlat, manifest);
|
let stableVersion = yield resolveStableVersionInput(versionSpec, arch, osPlat, manifest);
|
||||||
if (!stableVersion) {
|
if (!stableVersion) {
|
||||||
|
let archFilter = sys.getArch(arch);
|
||||||
|
let platFilter = sys.getPlatform();
|
||||||
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
|
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
|
||||||
let candidates = yield module.exports.getVersionsDist(dlUrl);
|
let candidates = yield module.exports.getVersionsDist(dlUrl);
|
||||||
if (!candidates) {
|
if (!candidates) {
|
||||||
|
@ -63244,8 +63246,12 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
|
||||||
const fixedCandidates = candidates.map(item => {
|
const fixedCandidates = candidates.map(item => {
|
||||||
return Object.assign(Object.assign({}, item), { version: makeSemver(item.version) });
|
return Object.assign(Object.assign({}, item), { version: makeSemver(item.version) });
|
||||||
});
|
});
|
||||||
stableVersion = yield resolveStableVersionInput(versionSpec, arch, osPlat, fixedCandidates);
|
stableVersion = yield resolveStableVersionInput(versionSpec, archFilter, platFilter, fixedCandidates);
|
||||||
|
if (!stableVersion) {
|
||||||
|
throw new Error(`Unable to find Go version '${versionSpec}' for platform ${osPlat} and architecture ${arch}.`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
versionSpec = stableVersion;
|
||||||
}
|
}
|
||||||
if (checkLatest) {
|
if (checkLatest) {
|
||||||
core.info('Attempting to resolve the latest version from the manifest...');
|
core.info('Attempting to resolve the latest version from the manifest...');
|
||||||
|
|
|
@ -52,6 +52,8 @@ export async function getGo(
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!stableVersion) {
|
if (!stableVersion) {
|
||||||
|
let archFilter = sys.getArch(arch);
|
||||||
|
let platFilter = sys.getPlatform();
|
||||||
const dlUrl: string = 'https://golang.org/dl/?mode=json&include=all';
|
const dlUrl: string = 'https://golang.org/dl/?mode=json&include=all';
|
||||||
let candidates:
|
let candidates:
|
||||||
| IGoVersion[]
|
| IGoVersion[]
|
||||||
|
@ -69,11 +71,19 @@ export async function getGo(
|
||||||
|
|
||||||
stableVersion = await resolveStableVersionInput(
|
stableVersion = await resolveStableVersionInput(
|
||||||
versionSpec,
|
versionSpec,
|
||||||
arch,
|
archFilter,
|
||||||
osPlat,
|
platFilter,
|
||||||
fixedCandidates
|
fixedCandidates
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!stableVersion) {
|
||||||
|
throw new Error(
|
||||||
|
`Unable to find Go version '${versionSpec}' for platform ${osPlat} and architecture ${arch}.`
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
versionSpec = stableVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkLatest) {
|
if (checkLatest) {
|
||||||
|
|
Loading…
Reference in New Issue