# Same gates as CI job go (subset): gofmt, vet, golangci-lint. $ErrorActionPreference = 'Stop' Set-Location (Join-Path $PSScriptRoot '..') $unfmt = gofmt -l . 2>$null if ($unfmt) { Write-Error "gofmt: unformatted files:`n$unfmt" } go vet ./... $golangci = Get-Command golangci-lint -ErrorAction SilentlyContinue if (-not $golangci) { $golangciPath = Join-Path $env:USERPROFILE 'go\bin\golangci-lint.exe' if (Test-Path $golangciPath) { $golangci = @{ Source = $golangciPath } } } if ($golangci) { & $golangci.Source run } else { Write-Warning 'lint-go: golangci-lint not found, skipping (CI will run it)' }