mirror of https://github.com/actions/setup-go.git
Merge 6ecdea2b64
into 4de67c04ab
This commit is contained in:
commit
61d80a8c5e
|
@ -93643,6 +93643,10 @@ function parseGoVersionFile(versionFilePath) {
|
||||||
const match = contents.match(/^go (\d+(\.\d+)*)/m);
|
const match = contents.match(/^go (\d+(\.\d+)*)/m);
|
||||||
return match ? match[1] : '';
|
return match ? match[1] : '';
|
||||||
}
|
}
|
||||||
|
else if (path.basename(versionFilePath) === '.tool-versions') {
|
||||||
|
const match = contents.match(/^golang\s+(\d+(\.\d+)*)/m);
|
||||||
|
return match ? match[1] : '';
|
||||||
|
}
|
||||||
return contents.trim();
|
return contents.trim();
|
||||||
}
|
}
|
||||||
exports.parseGoVersionFile = parseGoVersionFile;
|
exports.parseGoVersionFile = parseGoVersionFile;
|
||||||
|
|
|
@ -497,6 +497,9 @@ export function parseGoVersionFile(versionFilePath: string): string {
|
||||||
) {
|
) {
|
||||||
const match = contents.match(/^go (\d+(\.\d+)*)/m);
|
const match = contents.match(/^go (\d+(\.\d+)*)/m);
|
||||||
return match ? match[1] : '';
|
return match ? match[1] : '';
|
||||||
|
} else if (path.basename(versionFilePath) === '.tool-versions') {
|
||||||
|
const match = contents.match(/^golang\s+(\d+(\.\d+)*)/m);
|
||||||
|
return match ? match[1] : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return contents.trim();
|
return contents.trim();
|
||||||
|
|
Loading…
Reference in New Issue