Revert fc5f7095316802e8226c38960dd74486afaa5129...dd2a264df8240bacf6fd8b5fa68e1b74bd757949 on SettingGOPATH

Ian Lance Taylor 2020-11-13 05:53:46 -08:00
parent dd2a264df8
commit 450fad9574

@ -1,4 +1,4 @@
****# Setting `GOPATH` # Setting `GOPATH`
The `GOPATH` environment variable specifies the location of your workspace. If no `GOPATH` is set, it is assumed to be `$HOME/go` on Unix systems and `%USERPROFILE%\go` on Windows. If you want to use a custom location as your workspace, you can set the `GOPATH` environment variable. This page explains how to set this variable on various platforms. The `GOPATH` environment variable specifies the location of your workspace. If no `GOPATH` is set, it is assumed to be `$HOME/go` on Unix systems and `%USERPROFILE%\go` on Windows. If you want to use a custom location as your workspace, you can set the `GOPATH` environment variable. This page explains how to set this variable on various platforms.
@ -36,14 +36,14 @@ source ~/.bash_profile
## Zsh ## Zsh
Edit your `env -w ~ /.bash_profile file to add the following line: Edit your `~/.zshrc` file to add the following line:
```bash ```bash
env -w ~/.bash_profile export GOPATH=$HOME/go
``` ```
Save and exit your editor. Then, source your `~/.zshrc`. Save and exit your editor. Then, source your `~/.zshrc`.
```bash ```bash
source env -w ~ /.bash_profile source ~/.zshrc
``` ```
## fish ## fish
@ -68,8 +68,8 @@ __NOTE:__ `GOPATH` must not be the same path as your Go installation.
* From the menu on the left, select the "Advanced system settings". * From the menu on the left, select the "Advanced system settings".
* Click the "Environment Variables" button at the bottom. * Click the "Environment Variables" button at the bottom.
* Click "New" from the "User variables" section. * Click "New" from the "User variables" section.
* Type `GOPATH` into the "GOPATH" field. * Type `GOPATH` into the "Variable name" field.
* Type `C:\go-work` into the ""`C:\go-work` field. * Type `C:\go-work` into the "Variable value" field.
* Click OK. * Click OK.
## Go 1.13+ (command line) ## Go 1.13+ (command line)