\r
setlocal\r
\r
-if exist make.bat goto ok\r
-echo all.bat must be run from go\src\r
-exit /b 1\r
-:ok\r
+if not exist make.bat (\r
+ echo all.bat must be run from go\src\r
+ exit /b 1\r
+)\r
\r
-call .\make.bat --no-banner || goto fail\r
-call .\run.bat --no-rebuild || goto fail\r
+call .\make.bat --no-banner || exit /b 1\r
+call .\run.bat --no-rebuild || exit /b 1\r
..\bin\go tool dist banner\r
-goto :eof\r
-\r
-:fail\r
-exit /b 1\r
\r
setlocal\r
\r
-go tool dist env -w -p >env.bat || goto fail\r
+go tool dist env -w -p >env.bat || exit /b 1\r
call .\env.bat\r
del env.bat\r
echo.\r
\r
-if exist %GOTOOLDIR%\dist.exe goto distok\r
-echo cannot find %GOTOOLDIR%\dist; nothing to clean\r
-goto fail\r
-:distok\r
+if not exist %GOTOOLDIR%\dist.exe (\r
+ echo cannot find %GOTOOLDIR%\dist.exe; nothing to clean\r
+ exit /b 1\r
+)\r
\r
"%GOBIN%\go" clean -i std\r
"%GOBIN%\go" tool dist clean\r
"%GOBIN%\go" clean -i cmd\r
-\r
-goto :eof\r
-\r
-:fail\r
-exit /b 1\r
\r
setlocal\r
\r
-if exist make.bat goto ok\r
-echo Must run make.bat from Go src directory.\r
-goto fail\r
-:ok\r
+if not exist make.bat (\r
+ echo Must run make.bat from Go src directory.\r
+ exit /b 1\r
+)\r
\r
:: Clean old generated file that will cause problems in the build.\r
del /F ".\pkg\runtime\runtime_defs.go" 2>NUL\r
if "x%GOROOT_BOOTSTRAP%"=="x" set GOROOT_BOOTSTRAP=%HOMEDRIVE%%HOMEPATH%\Go1.4\r
\r
:bootstrapset\r
-if not exist "%GOROOT_BOOTSTRAP%\bin\go.exe" goto bootstrapfail\r
+if not exist "%GOROOT_BOOTSTRAP%\bin\go.exe" (\r
+ echo ERROR: Cannot find %GOROOT_BOOTSTRAP%\bin\go.exe\r
+ echo Set GOROOT_BOOTSTRAP to a working Go tree ^>= Go %bootgo%.\r
+ exit /b 1\r
+)\r
set GOROOT=%GOROOT_TEMP%\r
set GOROOT_TEMP=\r
\r
if x%vflag==x-v echo cmd/dist\r
set GOROOT=%GOROOT_BOOTSTRAP%\r
set GOBIN=\r
-"%GOROOT_BOOTSTRAP%\bin\go.exe" build -o cmd\dist\dist.exe .\cmd\dist || goto fail\r
+"%GOROOT_BOOTSTRAP%\bin\go.exe" build -o cmd\dist\dist.exe .\cmd\dist || exit /b 1\r
endlocal\r
-.\cmd\dist\dist.exe env -w -p >env.bat || goto fail\r
+.\cmd\dist\dist.exe env -w -p >env.bat || exit /b 1\r
call .\env.bat\r
del env.bat\r
if x%vflag==x-v echo.\r
:: Run dist bootstrap to complete make.bash.\r
:: Bootstrap installs a proper cmd/dist, built with the new toolchain.\r
:: Throw ours, built with the bootstrap toolchain, away after bootstrap.\r
-.\cmd\dist\dist.exe bootstrap -a %* || goto fail\r
+.\cmd\dist\dist.exe bootstrap -a %* || exit /b 1\r
del .\cmd\dist\dist.exe\r
goto :eof\r
\r
set GOARCH=\r
set GOEXPERIMENT=\r
set GOFLAGS=\r
-goto :eof\r
-\r
-:bootstrapfail\r
-echo ERROR: Cannot find %GOROOT_BOOTSTRAP%\bin\go.exe\r
-echo Set GOROOT_BOOTSTRAP to a working Go tree ^>= Go %bootgo%.\r
-\r
-:fail\r
-exit /b 1\r
\r
setlocal\r
\r
-if exist make.bat goto ok\r
-echo race.bat must be run from go\src\r
-exit /b 1\r
-:ok\r
+if not exist make.bat (\r
+ echo race.bat must be run from go\src\r
+ exit /b 1\r
+)\r
\r
set GOROOT=%CD%\..\r
-call .\make.bat --dist-tool >NUL || goto fail\r
-.\cmd\dist\dist.exe env -w -p >env.bat || goto fail\r
+call .\make.bat --dist-tool >NUL || exit /b 1\r
+.\cmd\dist\dist.exe env -w -p >env.bat || exit /b 1\r
call .\env.bat\r
del env.bat\r
\r
-if %GOHOSTARCH% == amd64 goto continue\r
-echo Race detector is only supported on windows/amd64.\r
-goto fail\r
+if not %GOHOSTARCH% == amd64 (\r
+ echo Race detector is only supported on windows/amd64.\r
+ exit /b 1\r
+)\r
\r
-:continue\r
-call .\make.bat --no-banner || goto fail\r
-echo # go install -race std\r
-go install -race std || goto fail\r
-go tool dist test -race || goto fail\r
-\r
-echo All tests passed.\r
-goto :eof\r
-\r
-:fail\r
-echo Fail.\r
-exit /b 1\r
+call .\make.bat --no-banner || exit /b 1\r
+go install -race std || exit /b 1\r
+go tool dist test -race || exit /b 1\r
\r
@echo off\r
\r
-if exist ..\bin\go.exe goto ok\r
-echo Must run run.bat from Go src directory after installing cmd/go.\r
-goto fail\r
-:ok\r
+if not exist ..\bin\go.exe (\r
+ echo Must run run.bat from Go src directory after installing cmd/go.\r
+ exit /b 1\r
+)\r
\r
setlocal\r
\r
set GOENV=off\r
-..\bin\go tool dist env > env.bat || goto fail\r
+..\bin\go tool dist env > env.bat || exit /b 1\r
call .\env.bat\r
del env.bat\r
\r
set GOPATH=c:\nonexist-gopath\r
-..\bin\go tool dist test --rebuild %* || goto fail\r
-goto :eof\r
-\r
-:fail\r
-exit /b 1\r
+..\bin\go tool dist test --rebuild %* || exit /b 1\r