This is a creation in Article, where the information may have evolved or changed.
There are many articles on the internet about Go's environment configuration, and none of them say the key points. For a newcomer, use the IDE instead of a text editor such as Sublime Text,vim. Of course, when you get started, you can play casually.
I recommend the new person to use liteide, strictly according to the following directory structure to create folders.
E:\go E:\go\go #go. bat file directory, this directory is the go Lang ZIP compressed package after decompression directory, go Environment core directory E:\go\GOPATH #扩展包或下载目录E: \go\dev# Development Project Storage Directory
Go.bat directly using the following.
@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
So Easy,enjoy the liteide.
Reference:
http://blog.csdn.net/fenglailea/article/details/41545585