mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
Revert fc5f7095316802e8226c38960dd74486afaa5129...dd2a264df8240bacf6fd8b5fa68e1b74bd757949 on SettingGOPATH
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.
|
||||
|
||||
@ -36,14 +36,14 @@ source ~/.bash_profile
|
||||
|
||||
## Zsh
|
||||
|
||||
Edit your `env -w ~ /.bash_profile file to add the following line:
|
||||
Edit your `~/.zshrc` file to add the following line:
|
||||
|
||||
```bash
|
||||
env -w ~/.bash_profile
|
||||
export GOPATH=$HOME/go
|
||||
```
|
||||
Save and exit your editor. Then, source your `~/.zshrc`.
|
||||
```bash
|
||||
source env -w ~ /.bash_profile
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
## 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".
|
||||
* Click the "Environment Variables" button at the bottom.
|
||||
* Click "New" from the "User variables" section.
|
||||
* Type `GOPATH` into the "GOPATH" field.
|
||||
* Type `C:\go-work` into the ""`C:\go-work` field.
|
||||
* Type `GOPATH` into the "Variable name" field.
|
||||
* Type `C:\go-work` into the "Variable value" field.
|
||||
* Click OK.
|
||||
|
||||
## Go 1.13+ (command line)
|
||||
|
Loading…
x
Reference in New Issue
Block a user