failing if go build/vet do not succeed
@@ -10,6 +10,7 @@ function Process-Sdk () {
if ($clean) {
Write-Host "##[command]Executing go clean -v ./... in " $currentDirectory
go clean -v ./...
+ if ($LASTEXITCODE) { exit $LASTEXITCODE }
}
if ($cleanGenerated) {
@@ -43,18 +44,20 @@ function Process-Sdk () {
if ($format) {
Write-Host "##[command]Executing gofmt -s -w . in " $currentDirectory
gofmt -s -w .
+ if ($LASTEXITCODE) {exit $LASTEXITCODE}
}
if ($tidy) {
Write-Host "##[command]Executing go mod tidy in " $currentDirectory
go mod tidy
+ if ($LASTEXITCODE) {exit $LASTEXITCODE}
}
if (!$skipBuild) {
Write-Host "##[command]Executing go build -x -v ./... in " $currentDirectory
go build -x -v ./...
Write-Host "##[command]Build Complete!"
-
+ if ($LASTEXITCODE) {exit $LASTEXITCODE}
}
if ($vet) {
