github.com/rafaeltorres324/go/src@v0.0.0-20210519164414-9fdf653a9838/run.bat (about) 1 :: Copyright 2012 The Go Authors. All rights reserved. 2 :: Use of this source code is governed by a BSD-style 3 :: license that can be found in the LICENSE file. 4 5 @echo off 6 7 if exist ..\bin\go.exe goto ok 8 echo Must run run.bat from Go src directory after installing cmd/go. 9 goto fail 10 :ok 11 12 :: Keep environment variables within this script 13 :: unless invoked with --no-local. 14 if x%1==x--no-local goto nolocal 15 if x%2==x--no-local goto nolocal 16 setlocal 17 :nolocal 18 19 set GOBUILDFAIL=0 20 21 :: we disallow local import for non-local packages, if %GOROOT% happens 22 :: to be under %GOPATH%, then some tests below will fail 23 set GOPATH= 24 :: Issue 14340: ignore GOBIN during all.bat. 25 set GOBIN= 26 set GOFLAGS= 27 set GO111MODULE= 28 29 rem TODO avoid rebuild if possible 30 31 if x%1==x--no-rebuild goto norebuild 32 echo ##### Building packages and commands. 33 ..\bin\go install -a -v std cmd 34 if errorlevel 1 goto fail 35 echo. 36 :norebuild 37 38 :: get CGO_ENABLED 39 ..\bin\go env > env.bat 40 if errorlevel 1 goto fail 41 call env.bat 42 del env.bat 43 echo. 44 45 ..\bin\go tool dist test 46 if errorlevel 1 goto fail 47 echo. 48 49 goto end 50 51 :fail 52 set GOBUILDFAIL=1 53 54 :end