From 6e0245c608c1563ad71995b75627ee4a7a3afbc5 Mon Sep 17 00:00:00 2001 From: Masahiro Furudate <178inaba.git@gmail.com> Date: Sat, 6 Apr 2024 03:00:41 +0900 Subject: [PATCH] Fix golang download url to go.dev --- src/installer.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/installer.ts b/src/installer.ts index 817c334..f229206 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -10,6 +10,8 @@ import {StableReleaseAlias} from './utils'; type InstallationType = 'dist' | 'manifest'; +const golangDownloadUrl = 'https://go.dev/dl/?mode=json&include=all'; + export interface IGoVersionFile { filename: string; // darwin, linux, windows @@ -335,9 +337,8 @@ export async function findMatch( let result: IGoVersion | undefined; let match: IGoVersion | undefined; - const dlUrl = 'https://golang.org/dl/?mode=json&include=all'; const candidates: IGoVersion[] | null = await module.exports.getVersionsDist( - dlUrl + golangDownloadUrl ); if (!candidates) { throw new Error(`golang download url did not return results`); @@ -434,9 +435,8 @@ export function parseGoVersionFile(versionFilePath: string): string { async function resolveStableVersionDist(versionSpec: string, arch: string) { const archFilter = sys.getArch(arch); const platFilter = sys.getPlatform(); - const dlUrl = 'https://golang.org/dl/?mode=json&include=all'; const candidates: IGoVersion[] | null = await module.exports.getVersionsDist( - dlUrl + golangDownloadUrl ); if (!candidates) { throw new Error(`golang download url did not return results`);