Merge pull request #837 from hendrikschneider/master

Corrected install instructions
This commit is contained in:
astaxie
2017-05-11 00:24:58 +08:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -107,7 +107,7 @@ Ubuntu is the most popular desktop release version of Linux. It uses `apt-get` t
sudo add-apt-repository ppa:gophers/go
sudo apt-get update
sudo apt-get install golang-stable
sudo apt-get install golang-go
### wget
```sh

View File

@@ -2,13 +2,13 @@
## $GOPATH
Go takes a unique approach to manage the code files with the introduction of a `$GOPATH` directory which contains all the go code in the machine. Note that this is different from the `$GOROOT` environment variable which states where go is installed on the machine. We have to define the $GOPATH variable before using the language, in *nix systems there is a file called `.bashrc` we need to append the below export statement to the file. The concept behind gopath is a novel one, where we can link to any go code at any instant of time without ambiguity.
Go takes a unique approach to manage the code files with the introduction of a `$GOPATH` directory which contains all the go code in the machine. Note that this is different from the `$GOROOT` environment variable which states where go is installed on the machine. We have to define the $GOPATH variable before using the language, in *nix systems there is a file called `.profile` we need to append the below export statement to the file. The concept behind gopath is a novel one, where we can link to any go code at any instant of time without ambiguity.
Starting from go 1.8, the GOPATH environment variable now has a default value if it is unset. It defaults to $HOME/go on Unix and %USERPROFILE%/go on Windows.
In Unix-like systems, the variable should be used like this:
export GOPATH=/home/apple/mygo
export GOPATH=${HOME}/mygo
In Windows, you need to create a new environment variable called GOPATH, then set its value to `c:\mygo`( ***This value depends on where your workspace is located*** )