Merge pull request #39879 from thaJeztah/fix_go_version_check_again

hack/ci/windows.ps1: fix Go version check (due to trailing .0)
This commit is contained in:
Tibor Vass 2019-09-11 17:34:45 -07:00 committed by GitHub
commit 2900a919f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -214,7 +214,8 @@ RUN `
Download-File $location C:\gitsetup.zip; `
`
Write-Host INFO: Downloading go...; `
Download-File $('https://golang.org/dl/go'+$Env:GO_VERSION.TrimEnd('.0')"+'.windows-amd64.zip') C:\go.zip; `
$dlGoVersion=$Env:GO_VERSION -replace '\.0$',''; `
Download-File "https://golang.org/dl/go${dlGoVersion}.windows-amd64.zip" C:\go.zip; `
`
Write-Host INFO: Downloading compiler 1 of 3...; `
Download-File https://raw.githubusercontent.com/jhowardmsft/docker-tdmgcc/master/gcc.zip C:\gcc.zip; `

View File

@ -134,7 +134,7 @@ Function Check-InContainer() {
# outside of a container where it may be out of date with master.
Function Verify-GoVersion() {
Try {
$goVersionDockerfile=(Select-String -Path ".\Dockerfile" -Pattern "^ARG[\s]+GO_VERSION=(.*)$").Matches.groups[1].Value.TrimEnd(".0")
$goVersionDockerfile=(Select-String -Path ".\Dockerfile" -Pattern "^ARG[\s]+GO_VERSION=(.*)$").Matches.groups[1].Value -replace '\.0$',''
$goVersionInstalled=(go version).ToString().Split(" ")[2].SubString(2)
}
Catch [Exception] {