This is a creation in Article, where the information may have evolved or changed.
The purpose of this is for my thief to be lazy.
Author: The wind is coming. The Fox
Using the Go Lang zip compression pack installation, you can set environment variables automatically
How to use
Save as Go.bat into the Go directory, execute Go.bat, where Goarch to be based on the number of system bits set, this is a 64-bit system
Principle: SETX Setting User Environment variables
System: Win7 and above are available, WinXP cannot be used
Directory format
E:\goe:\go\go #go. bat file directory, which is the directory of the Go Lang ZIP archive after decompression E:\go\gopathe:\go\dev
Lite version
@ECHO OFF if EXIST%cd%\bin\go.exe (if EXIST%systemroot%\system32\setx.exe (REM processor architecture 386/amd64/arm@setx Goarch Amd64re M operating system Darwin/freebsd/linux/windows@setx GOOS Windowsrem Go on your PC installation location @setx goroot%cd%rem compiler and linker installation location, default is $GOROOT/bin , in general you can set its value to NULL, GO will use the default value mentioned earlier @setx GOBIN%cd%\binrem defaults to the same value as $GOROOT, but from the Go 1.1 version, you have to change to a different path. It can contain multiple paths containing the Go language source files, package files, and executables, which must contain three specified directories: src,pkg and bin, three directories for source files, package files, and executables, respectively @setx Gopath%cd:~0,-3 %\gopathrem Sex Default set User environment variable, plus/M set system environment variable REM such as setx/m path_home ";%go_bin%;" Set system environment variable @setx PATH ";%cd%\bin;" Echo.echo.echo.echo.echo.ECHO
Full version: