github.com/AESNooper/go/src@v0.0.0-20220218095104-b56a4ab1bbbb/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 set GOPATH=c:\nonexist-gopath 22 :: Issue 14340: ignore GOBIN during all.bat. 23 set GOBIN= 24 set GOFLAGS= 25 set GO111MODULE= 26 27 rem TODO avoid rebuild if possible 28 29 if x%1==x--no-rebuild goto norebuild 30 echo ##### Building packages and commands. 31 ..\bin\go install -a -v std cmd 32 if errorlevel 1 goto fail 33 echo. 34 :norebuild 35 36 :: get CGO_ENABLED 37 ..\bin\go env > env.bat 38 if errorlevel 1 goto fail 39 call env.bat 40 del env.bat 41 echo. 42 43 ..\bin\go tool dist test 44 if errorlevel 1 goto fail 45 echo. 46 47 goto end 48 49 :fail 50 set GOBUILDFAIL=1 51 52 :end