\r
set GOBUILDFAIL=0\r
\r
-:: we disallow local import for non-local packages, if %GOROOT% happens\r
-:: to be under %GOPATH%, then some tests below will fail\r
-set GOPATH=\r
-:: Issue 14340: ignore GOBIN during all.bat.\r
-set GOBIN=\r
-set GOFLAGS=\r
-set GO111MODULE=\r
-\r
-rem TODO avoid rebuild if possible\r
-\r
-if x%1==x--no-rebuild goto norebuild\r
-echo ##### Building packages and commands.\r
-..\bin\go install -a -v std cmd\r
+set GOENV=off\r
+..\bin\go tool dist env > env.bat\r
if errorlevel 1 goto fail\r
-echo.\r
-:norebuild\r
+call .\env.bat\r
+del env.bat\r
\r
-:: we must unset GOROOT_FINAL before tests, because runtime/debug requires\r
-:: correct access to source code, so if we have GOROOT_FINAL in effect,\r
-:: at least runtime/debug test will fail.\r
-set GOROOT_FINAL=\r
+set GOPATH=c:\nonexist-gopath\r
\r
-:: get CGO_ENABLED\r
-..\bin\go env > env.bat\r
+if x%1==x--no-rebuild goto norebuild\r
+..\bin\go tool dist test --rebuild\r
if errorlevel 1 goto fail\r
-call env.bat\r
-del env.bat\r
-echo.\r
+goto end\r
\r
+:norebuild\r
..\bin\go tool dist test\r
if errorlevel 1 goto fail\r
-echo.\r
-\r
goto end\r
\r
:fail\r