@echo off setlocal cd /d "%~dp0" rem Pre-commit check shared by local builds and CI: gofmt, vet, test. echo [1/3] gofmt ... set "FMT=%TEMP%\mygoland-gofmt-%RANDOM%.txt" gofmt -l . > "%FMT%" 2>&1 if errorlevel 1 ( type "%FMT%" echo gofmt failed to run del "%FMT%" >nul 2>&1 exit /b 1 ) findstr /r /c:"[^ ]" "%FMT%" >nul if not errorlevel 1 ( echo Files need gofmt -w: type "%FMT%" del "%FMT%" >nul 2>&1 exit /b 1 ) del "%FMT%" >nul 2>&1 echo [2/3] go vet ./... ... go vet ./... if errorlevel 1 ( echo go vet failed exit /b 1 ) echo [3/3] go test ./... -count=1 -timeout 480s ... go test ./... -count=1 -timeout 480s if errorlevel 1 ( echo tests failed exit /b 1 ) echo VERIFY OK: gofmt / vet / test all green exit /b 0