Skip to content

Commit 4b73464

Browse files
authored
Fix golang download url to go.dev (#469)
* Fix golang download url to go.dev * Fix const name * Run `npm run build`
1 parent a5f9b05 commit 4b73464

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

dist/setup/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49585,6 +49585,7 @@ const MANIFEST_REPO_OWNER = 'actions';
4958549585
const MANIFEST_REPO_NAME = 'go-versions';
4958649586
const MANIFEST_REPO_BRANCH = 'main';
4958749587
const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`;
49588+
const GOLANG_DOWNLOAD_URL = 'https://go.dev/dl/?mode=json&include=all';
4958849589
function getGo(versionSpec_1, checkLatest_1, auth_1) {
4958949590
return __awaiter(this, arguments, void 0, function* (versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
4959049591
var _a;
@@ -49846,8 +49847,7 @@ function findMatch(versionSpec_1) {
4984649847
const platFilter = sys.getPlatform();
4984749848
let result;
4984849849
let match;
49849-
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
49850-
const candidates = yield module.exports.getVersionsDist(dlUrl);
49850+
const candidates = yield module.exports.getVersionsDist(GOLANG_DOWNLOAD_URL);
4985149851
if (!candidates) {
4985249852
throw new Error(`golang download url did not return results`);
4985349853
}
@@ -49937,8 +49937,7 @@ function resolveStableVersionDist(versionSpec, arch) {
4993749937
return __awaiter(this, void 0, void 0, function* () {
4993849938
const archFilter = sys.getArch(arch);
4993949939
const platFilter = sys.getPlatform();
49940-
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
49941-
const candidates = yield module.exports.getVersionsDist(dlUrl);
49940+
const candidates = yield module.exports.getVersionsDist(GOLANG_DOWNLOAD_URL);
4994249941
if (!candidates) {
4994349942
throw new Error(`golang download url did not return results`);
4994449943
}

src/installer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/$
1818

1919
type InstallationType = 'dist' | 'manifest';
2020

21+
const GOLANG_DOWNLOAD_URL = 'https://go.dev/dl/?mode=json&include=all';
22+
2123
export interface IGoVersionFile {
2224
filename: string;
2325
// darwin, linux, windows
@@ -409,9 +411,8 @@ export async function findMatch(
409411
let result: IGoVersion | undefined;
410412
let match: IGoVersion | undefined;
411413

412-
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
413414
const candidates: IGoVersion[] | null = await module.exports.getVersionsDist(
414-
dlUrl
415+
GOLANG_DOWNLOAD_URL
415416
);
416417
if (!candidates) {
417418
throw new Error(`golang download url did not return results`);
@@ -527,9 +528,8 @@ async function resolveStableVersionDist(
527528
) {
528529
const archFilter = sys.getArch(arch);
529530
const platFilter = sys.getPlatform();
530-
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
531531
const candidates: IGoVersion[] | null = await module.exports.getVersionsDist(
532-
dlUrl
532+
GOLANG_DOWNLOAD_URL
533533
);
534534
if (!candidates) {
535535
throw new Error(`golang download url did not return results`);

0 commit comments

Comments
 (0)