@@ -2528,10 +2528,7 @@ function run() {
2528
2528
let token = core . getInput ( 'token' ) ;
2529
2529
let auth = ! token || isGhes ( ) ? undefined : `token ${ token } ` ;
2530
2530
const installDir = yield installer . getGo ( versionSpec , stable , auth ) ;
2531
- console . log ( `installDir is ${ installDir } ` ) ;
2532
2531
core . exportVariable ( 'GOROOT' , installDir ) ;
2533
- const content = fs_1 . default . readdirSync ( path_1 . default . join ( installDir , "go" ) ) ;
2534
- console . log ( content ) ;
2535
2532
core . addPath ( path_1 . default . join ( installDir , 'bin' ) ) ;
2536
2533
console . log ( 'Added go to the path' ) ;
2537
2534
let added = addBinToPath ( ) ;
@@ -6932,6 +6929,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6932
6929
exports . makeSemver = exports . getVersionsDist = exports . getInfoFromManifest = exports . findMatch = exports . extractGoArchive = exports . getGo = void 0 ;
6933
6930
const tc = __importStar ( __webpack_require__ ( 533 ) ) ;
6934
6931
const core = __importStar ( __webpack_require__ ( 470 ) ) ;
6932
+ const path = __importStar ( __webpack_require__ ( 622 ) ) ;
6935
6933
const semver = __importStar ( __webpack_require__ ( 876 ) ) ;
6936
6934
const httpm = __importStar ( __webpack_require__ ( 539 ) ) ;
6937
6935
const sys = __importStar ( __webpack_require__ ( 737 ) ) ;
@@ -6958,7 +6956,8 @@ function getGo(versionSpec, stable, auth) {
6958
6956
info = yield getInfoFromManifest ( makeSemver ( versionSpec ) , stable , auth ) ;
6959
6957
console . log ( `info is ${ info } ` ) ;
6960
6958
if ( info ) {
6961
- downloadPath = yield installGoVersion ( info , auth ) ;
6959
+ const contentPath = yield installGoVersion ( info , auth ) ;
6960
+ downloadPath = yield yield tc . cacheDir ( contentPath , 'go' , makeSemver ( info . resolvedVersion ) ) ;
6962
6961
}
6963
6962
else {
6964
6963
console . log ( 'Not found in manifest. Falling back to download directly from Go' ) ;
@@ -6984,7 +6983,8 @@ function getGo(versionSpec, stable, auth) {
6984
6983
throw new Error ( `Unable to find Go version '${ versionSpec } ' for platform ${ osPlat } and architecture ${ osArch } .` ) ;
6985
6984
}
6986
6985
try {
6987
- downloadPath = yield installGoVersion ( info , undefined ) ;
6986
+ const contentDir = yield installGoVersion ( info , undefined ) ;
6987
+ downloadPath = yield tc . cacheDir ( path . join ( contentDir , "go" ) , 'go' , makeSemver ( info . resolvedVersion ) ) ;
6988
6988
}
6989
6989
catch ( err ) {
6990
6990
throw new Error ( `Failed to download version ${ versionSpec } : ${ err } ` ) ;
0 commit comments