Skip to content

Commit

Permalink
Fix GoLang test runs on Windows
Browse files Browse the repository at this point in the history
Because of golang/go#27089, we need to disable go vet support in
go test on Windows. It's a handy tool, though, so we should leave it
enabled on Linux so it runs on the build machines, etc.
  • Loading branch information
alastairs committed Jun 27, 2019
1 parent 5cc4246 commit b42ae60
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ function Register-CustomAssertions([string]$path) {
Task Test Build, {
try {
pushd $RootDir
exec { go test -v -race ./... }

$vet = Allow-Vet
exec { go test -v $vet -race ./... }

Register-CustomAssertions "test/assertions/pester"

Expand All @@ -70,4 +72,14 @@ Task Test Build, {
}
}

function Allow-Vet {
$os = $PSVersionTable.OS
if (($os -eq $null) -or ($os.StartsWith("Microsoft Windows"))) {
Write-Warning "OS is Windows, disabling go vet (see golang/go#27089)"
return "-vet=off"
}

return ""
}

Task . PackageRestore, Build

0 comments on commit b42ae60

Please sign in to comment.