Skip to content

Commit b8eec33

Browse files
committed
Merge branch 'main' into use-actual-version-in-cache
2 parents b27afcd + 8075593 commit b8eec33

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ steps:
155155
```
156156
## Getting go version from the go.mod file
157157

158-
The `go-version-file` input accepts a path to a `go.mod` file or a `go.work` file that contains the version of Go to be used by a project. As the `go.mod` file contains only major and minor (e.g. 1.18) tags, the action will search for the latest available patch version sequentially in the runner's directory with the cached tools, in the [version-manifest.json](https://github.com/actions/go-versions/blob/main/versions-manifest.json) file or at the go servers.
158+
The `go-version-file` input accepts a path to a `go.mod` file or a `go.work` file that contains the version of Go to be used by a project. As the `go.mod` file contains only major and minor (e.g. 1.18) tags, the action will search for the latest available patch version sequentially in the runner's directory with the cached tools, in the [versions-manifest.json](https://github.com/actions/go-versions/blob/main/versions-manifest.json) file or at the go servers.
159159

160160
If both the `go-version` and the `go-version-file` inputs are provided then the `go-version` input is used.
161161
> The action will search for the `go.mod` file relative to the repository root

dist/setup/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63398,12 +63398,12 @@ function getInfoFromDist(versionSpec, arch) {
6339863398
}
6339963399
function findMatch(versionSpec, arch = os_1.default.arch()) {
6340063400
return __awaiter(this, void 0, void 0, function* () {
63401-
let archFilter = sys.getArch(arch);
63402-
let platFilter = sys.getPlatform();
63401+
const archFilter = sys.getArch(arch);
63402+
const platFilter = sys.getPlatform();
6340363403
let result;
6340463404
let match;
6340563405
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
63406-
let candidates = yield module.exports.getVersionsDist(dlUrl);
63406+
const candidates = yield module.exports.getVersionsDist(dlUrl);
6340763407
if (!candidates) {
6340863408
throw new Error(`golang download url did not return results`);
6340963409
}
@@ -63436,7 +63436,7 @@ exports.findMatch = findMatch;
6343663436
function getVersionsDist(dlUrl) {
6343763437
return __awaiter(this, void 0, void 0, function* () {
6343863438
// this returns versions descending so latest is first
63439-
let http = new httpm.HttpClient('setup-go', [], {
63439+
const http = new httpm.HttpClient('setup-go', [], {
6344063440
allowRedirects: true,
6344163441
maxRedirects: 3
6344263442
});
@@ -63484,7 +63484,7 @@ function resolveStableVersionDist(versionSpec, arch) {
6348463484
let archFilter = sys.getArch(arch);
6348563485
let platFilter = sys.getPlatform();
6348663486
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
63487-
let candidates = yield module.exports.getVersionsDist(dlUrl);
63487+
const candidates = yield module.exports.getVersionsDist(dlUrl);
6348863488
if (!candidates) {
6348963489
throw new Error(`golang download url did not return results`);
6349063490
}

src/installer.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,14 @@ export async function findMatch(
266266
versionSpec: string,
267267
arch = os.arch()
268268
): Promise<IGoVersion | undefined> {
269-
let archFilter = sys.getArch(arch);
270-
let platFilter = sys.getPlatform();
269+
const archFilter = sys.getArch(arch);
270+
const platFilter = sys.getPlatform();
271271

272272
let result: IGoVersion | undefined;
273273
let match: IGoVersion | undefined;
274274

275-
const dlUrl: string = 'https://golang.org/dl/?mode=json&include=all';
276-
let candidates: IGoVersion[] | null = await module.exports.getVersionsDist(
275+
const dlUrl = 'https://golang.org/dl/?mode=json&include=all';
276+
const candidates: IGoVersion[] | null = await module.exports.getVersionsDist(
277277
dlUrl
278278
);
279279
if (!candidates) {
@@ -315,7 +315,7 @@ export async function getVersionsDist(
315315
dlUrl: string
316316
): Promise<IGoVersion[] | null> {
317317
// this returns versions descending so latest is first
318-
let http: httpm.HttpClient = new httpm.HttpClient('setup-go', [], {
318+
const http: httpm.HttpClient = new httpm.HttpClient('setup-go', [], {
319319
allowRedirects: true,
320320
maxRedirects: 3
321321
});
@@ -372,7 +372,7 @@ async function resolveStableVersionDist(versionSpec: string, arch: string) {
372372
let archFilter = sys.getArch(arch);
373373
let platFilter = sys.getPlatform();
374374
const dlUrl: string = 'https://golang.org/dl/?mode=json&include=all';
375-
let candidates: IGoVersion[] | null = await module.exports.getVersionsDist(
375+
const candidates: IGoVersion[] | null = await module.exports.getVersionsDist(
376376
dlUrl
377377
);
378378
if (!candidates) {

0 commit comments

Comments
 (0)