diff --git a/build/build.ps1 b/build/build.ps1 index 02bcd6a..5868489 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -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" @@ -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