mirror of
https://github.com/actions/setup-go.git
synced 2026-04-05 04:09:25 +00:00
Merge d176b82c0a into 4a3601121d
This commit is contained in:
commit
9ec2c28c8d
4 changed files with 106938 additions and 152544 deletions
|
|
@ -1059,6 +1059,12 @@ use .
|
|||
expected_version: version,
|
||||
desc: 'from toolchain directive'
|
||||
},
|
||||
{
|
||||
goVersionfile: 'golangci-lint.mod',
|
||||
fileContents: Buffer.from(buildGoMod(placeholderVersion, version)),
|
||||
expected_version: version,
|
||||
desc: 'from toolchain directive in non-standard .mod file'
|
||||
},
|
||||
{
|
||||
goVersionfile: 'go.mod',
|
||||
fileContents: Buffer.from(buildGoMod(placeholderVersion, version)),
|
||||
|
|
@ -1072,6 +1078,13 @@ use .
|
|||
gotoolchain_env: 'local',
|
||||
expected_version: placeholderVersion,
|
||||
desc: 'from go directive when GOTOOLCHAIN is local'
|
||||
},
|
||||
{
|
||||
goVersionfile: 'golangci-lint.mod',
|
||||
fileContents: Buffer.from(buildGoMod(placeholderVersion, version)),
|
||||
gotoolchain_env: 'local',
|
||||
expected_version: placeholderVersion,
|
||||
desc: 'from go directive in non-standard .mod file when GOTOOLCHAIN is local'
|
||||
}
|
||||
].forEach(test => {
|
||||
it(`reads version (${version}) in ${test.goVersionfile} ${test.desc}`, async () => {
|
||||
|
|
|
|||
129800
dist/cache-save/index.js
vendored
129800
dist/cache-save/index.js
vendored
File diff suppressed because one or more lines are too long
129667
dist/setup/index.js
vendored
129667
dist/setup/index.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -654,7 +654,7 @@ export function parseGoVersionFile(versionFilePath: string): string {
|
|||
const contents = fs.readFileSync(versionFilePath).toString();
|
||||
|
||||
if (
|
||||
path.basename(versionFilePath) === 'go.mod' ||
|
||||
versionFilePath.endsWith('.mod') ||
|
||||
path.basename(versionFilePath) === 'go.work'
|
||||
) {
|
||||
// for backwards compatibility: use version from go directive if
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue