Skip to content

Commit

Permalink
Fix golang download url to go.dev
Browse files Browse the repository at this point in the history
  • Loading branch information
178inaba committed Apr 5, 2024
1 parent be1aa11 commit d7cb9bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`);
Expand Down Expand Up @@ -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`);
Expand Down

0 comments on commit d7cb9bd

Please sign in to comment.