This is a creation in Article, where the information may have evolved or changed.
1. Goroot Gopath and PATH Setup
A. adding a system variable Goroot: The first thing you do when you install Go is set up goroot. For example, my Go installation is in C:\Go, set goroot = C:\Go
B. modify the Environment change path: Add the%goroot%\bin to the environment variable path, this can be directly in the DOS command mode in the operation of any%goroot%\bin program such as: Go.exe Godoc.exe
C. add a system variable Gopath: Gopath is an important change in the way the package is loaded. You can set multiple paths, separated by a dividing number (;).
For example my gopath = D:\data\golang\letsgo; D:\data\golang; D:\data\golang\beego;d:\data\golang\beeweb;
I import a non-existent xxx bag
The following mistakes are reported ( the important role of Gopath in package loading ):
Note: The source code of the package to be loaded must be placed in the Gopath path of the src Catalog, or it is not prompted to download the package
2. Go get download Source system
There are various dependencies in the general source project, and a Fock is too troublesome. Try the go get command.
Below I use go get to obtain a source blogging system (Github.com/lisijie/goblog) on GitHub:
1. Set the project path to Gopath (at the front of Gopath, go get will download the code to the first item in the Gopath)
such as: I downloaded the blog system to D:\data\golang\goblog, Gopath = D:\data\golang\goblog;d:\data\golang\letsgo; D:\data\golang; D:\data\golang\beego;d:\data\golang\beeweb;
Note: If you have a git shell reboot to restart the Git shell, the Gopath setup is not yet in effect ...
2. Run the go get github.com/lisijie/goblog in git shell for a few minutes ...
3. Enter the D:\data\golang\goblog to see the next download code.