4
0
Fork 0
mirror of https://github.com/actions/setup-go.git synced 2025-11-10 13:56:55 +00:00

Compare commits

...

5 commits

Author SHA1 Message Date
Masahiro Furudate
ba6f0c1368
Merge daa46e9a61 into c0137caad7 2025-09-17 07:07:02 +07:00
Masahiro Furudate
daa46e9a61 Fix README
Fix `golang.org` to `go.dev`.
2025-06-08 17:21:26 +09:00
Masahiro Furudate
c874788d3c Run npm run build 2025-06-08 17:21:21 +09:00
Masahiro Furudate
5eedbcc4c8 Fix const name 2025-06-08 17:20:33 +09:00
Masahiro Furudate
65f08372d6 Fix golang download url to go.dev 2025-06-08 17:20:33 +09:00
3 changed files with 8 additions and 9 deletions

View file

@ -190,7 +190,7 @@ The version can specify a patch version or omit it altogether (e.g., `go 1.22.0`
If a patch version is specified, that specific patch version will be used. If a patch version is specified, that specific patch version will be used.
If no patch version is specified, it will search for the latest available patch version in the cache, If no patch version is specified, it will search for the latest available patch version in the cache,
[versions-manifest.json](https://github.com/actions/go-versions/blob/main/versions-manifest.json), and the [versions-manifest.json](https://github.com/actions/go-versions/blob/main/versions-manifest.json), and the
[official Go language website](https://golang.org/dl/?mode=json&include=all), in that order. [official Go language website](https://go.dev/dl/?mode=json&include=all), in that order.
If both the `go-version` and the `go-version-file` inputs are provided then the `go-version` input is used. If both the `go-version` and the `go-version-file` inputs are provided then the `go-version` input is used.
> The action will search for the `go.mod` file relative to the repository root > The action will search for the `go.mod` file relative to the repository root

7
dist/setup/index.js vendored
View file

@ -94337,6 +94337,7 @@ const MANIFEST_REPO_OWNER = 'actions';
const MANIFEST_REPO_NAME = 'go-versions'; const MANIFEST_REPO_NAME = 'go-versions';
const MANIFEST_REPO_BRANCH = 'main'; const MANIFEST_REPO_BRANCH = 'main';
const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`; const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`;
const GOLANG_DOWNLOAD_URL = 'https://go.dev/dl/?mode=json&include=all';
function getGo(versionSpec_1, checkLatest_1, auth_1) { function getGo(versionSpec_1, checkLatest_1, auth_1) {
return __awaiter(this, arguments, void 0, function* (versionSpec, checkLatest, auth, arch = os_1.default.arch()) { return __awaiter(this, arguments, void 0, function* (versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
var _a; var _a;
@ -94598,8 +94599,7 @@ function findMatch(versionSpec_1) {
const platFilter = sys.getPlatform(); const platFilter = sys.getPlatform();
let result; let result;
let match; let match;
const dlUrl = 'https://golang.org/dl/?mode=json&include=all'; const candidates = yield module.exports.getVersionsDist(GOLANG_DOWNLOAD_URL);
const candidates = yield module.exports.getVersionsDist(dlUrl);
if (!candidates) { if (!candidates) {
throw new Error(`golang download url did not return results`); throw new Error(`golang download url did not return results`);
} }
@ -94685,8 +94685,7 @@ function resolveStableVersionDist(versionSpec, arch) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const archFilter = sys.getArch(arch); const archFilter = sys.getArch(arch);
const platFilter = sys.getPlatform(); const platFilter = sys.getPlatform();
const dlUrl = 'https://golang.org/dl/?mode=json&include=all'; const candidates = yield module.exports.getVersionsDist(GOLANG_DOWNLOAD_URL);
const candidates = yield module.exports.getVersionsDist(dlUrl);
if (!candidates) { if (!candidates) {
throw new Error(`golang download url did not return results`); throw new Error(`golang download url did not return results`);
} }

View file

@ -18,6 +18,8 @@ const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/$
type InstallationType = 'dist' | 'manifest'; type InstallationType = 'dist' | 'manifest';
const GOLANG_DOWNLOAD_URL = 'https://go.dev/dl/?mode=json&include=all';
export interface IGoVersionFile { export interface IGoVersionFile {
filename: string; filename: string;
// darwin, linux, windows // darwin, linux, windows
@ -409,9 +411,8 @@ export async function findMatch(
let result: IGoVersion | undefined; let result: IGoVersion | undefined;
let match: IGoVersion | undefined; let match: IGoVersion | undefined;
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
const candidates: IGoVersion[] | null = await module.exports.getVersionsDist( const candidates: IGoVersion[] | null = await module.exports.getVersionsDist(
dlUrl GOLANG_DOWNLOAD_URL
); );
if (!candidates) { if (!candidates) {
throw new Error(`golang download url did not return results`); throw new Error(`golang download url did not return results`);
@ -524,9 +525,8 @@ async function resolveStableVersionDist(
) { ) {
const archFilter = sys.getArch(arch); const archFilter = sys.getArch(arch);
const platFilter = sys.getPlatform(); const platFilter = sys.getPlatform();
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
const candidates: IGoVersion[] | null = await module.exports.getVersionsDist( const candidates: IGoVersion[] | null = await module.exports.getVersionsDist(
dlUrl GOLANG_DOWNLOAD_URL
); );
if (!candidates) { if (!candidates) {
throw new Error(`golang download url did not return results`); throw new Error(`golang download url did not return results`);