mirror of
				https://github.com/actions/setup-go.git
				synced 2025-10-30 23:06:22 +00:00 
			
		
		
		
	mocked tests work with no internet
This commit is contained in:
		
							
								
								
									
										15
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -4558,7 +4558,7 @@ module.exports = require("fs"); | ||||
| /***/ }), | ||||
|  | ||||
| /***/ 749: | ||||
| /***/ (function(__unusedmodule, exports, __webpack_require__) { | ||||
| /***/ (function(module, exports, __webpack_require__) { | ||||
|  | ||||
| "use strict"; | ||||
|  | ||||
| @@ -4614,9 +4614,7 @@ function findMatch(versionSpec, stable) { | ||||
|         let platFilter = sys.getPlatform(); | ||||
|         let match; | ||||
|         const dlUrl = 'https://golang.org/dl/?mode=json&include=all'; | ||||
|         // this returns versions descending so latest is first | ||||
|         let http = new httpm.HttpClient('setup-go'); | ||||
|         let candidates = (yield http.getJson(dlUrl)).result; | ||||
|         let candidates = yield module.exports.getVersions(dlUrl); | ||||
|         if (!candidates) { | ||||
|             throw new Error(`golang download url did not return results: ${dlUrl}`); | ||||
|         } | ||||
| @@ -4647,6 +4645,15 @@ function findMatch(versionSpec, stable) { | ||||
|     }); | ||||
| } | ||||
| exports.findMatch = findMatch; | ||||
| function getVersions(dlUrl) { | ||||
|     return __awaiter(this, void 0, void 0, function* () { | ||||
|         // this returns versions descending so latest is first | ||||
|         let http = new httpm.HttpClient('setup-go'); | ||||
|         let candidates = (yield http.getJson(dlUrl)).result; | ||||
|         return candidates; | ||||
|     }); | ||||
| } | ||||
| exports.getVersions = getVersions; | ||||
|  | ||||
|  | ||||
| /***/ }), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user