Skip to content

Commit 83124a1

Browse files
committed
Do not export GOROOT
This has not been necessary since [Go 1.9](https://go.dev/doc/go1.9#goroot) at least (although clunky to do so then) but definitely not since [Go 1.10](https://go.dev/doc/go1.10#goroot). This is cargo culting code that is more than 2 years out of date and runs into issues when multiple go versions are used in an action run. Signed-off-by: Manuel Mendez <mmendez534@gmail.com>
1 parent ec07be5 commit 83124a1

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

__tests__/setup-go.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ describe('setup-go', () => {
231231
expect(logSpy).toHaveBeenCalledWith(`Setup go version spec 1.13.0`);
232232
});
233233

234-
it('exports GOROOT', async () => {
234+
it('does not export any varibles', async () => {
235235
inputs['go-version'] = '1.13.0';
236236
inSpy.mockImplementation(name => inputs[name]);
237237

@@ -244,7 +244,7 @@ describe('setup-go', () => {
244244
});
245245

246246
await main.run();
247-
expect(vars).toBe({GOROOT: 'foo'});
247+
expect(vars).toStrictEqual({});
248248
});
249249

250250
it('finds a version of go already in the cache', async () => {

dist/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2080,7 +2080,6 @@ function run() {
20802080
let auth = !token || isGhes() ? undefined : `token ${token}`;
20812081
const checkLatest = core.getBooleanInput('check-latest');
20822082
const installDir = yield installer.getGo(versionSpec, checkLatest, auth);
2083-
core.exportVariable('GOROOT', installDir);
20842083
core.addPath(path_1.default.join(installDir, 'bin'));
20852084
core.info('Added go to the path');
20862085
let added = yield addBinToPath();

src/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export async function run() {
2323
const checkLatest = core.getBooleanInput('check-latest');
2424
const installDir = await installer.getGo(versionSpec, checkLatest, auth);
2525

26-
core.exportVariable('GOROOT', installDir);
2726
core.addPath(path.join(installDir, 'bin'));
2827
core.info('Added go to the path');
2928

0 commit comments

Comments
 (0)