Skip to main content
added 72 characters in body; deleted 116 characters in body
Source Link
Inanc Gumus
  • 28.2k
  • 10
  • 89
  • 104

Shortest and current solution.

Write this code in Terminal.

export GOPATH=path/to/your/gopath/directory 

Note: This will reset on every new Terminal window or system restart.

To be persistent, paste the code below in your .zshrc or .bashrc file according to your shell. Those files in your Home Directory. It will be like below.

export PATH=path/to/some/other/place/composer/for/example export GOPATH=path/to/your/gopath/directory export PATH=$PATH:$GOPATH/bin 

Shortest and current solution.

Write this code in Terminal.

export GOPATH=path/to/your/gopath/directory 

Note: This will reset on every new Terminal window or system restart.

To be persistent, paste the code below in your .zshrc or .bashrc file according to your shell. Those files in your Home Directory. It will be like below.

export PATH=path/to/some/other/place/composer/for/example export GOPATH=path/to/your/gopath/directory export PATH=$PATH:$GOPATH/bin 

Write this code in Terminal.

export GOPATH=path/to/your/gopath/directory 

Note: This will reset on every new Terminal window or system restart.

To be persistent, paste the code below in your .zshrc or .bashrc file according to your shell. Those files in your Home Directory. It will be like below.

export PATH=path/to/some/other/place/composer/for/example export GOPATH=path/to/your/gopath/directory export PATH=$PATH:$GOPATH/bin 
cleared quotes
Source Link
atilkan
  • 5.1k
  • 1
  • 33
  • 36

Shortest and current solution.

Write this code in Terminal.

export GOPATH="pathGOPATH=path/to/your/gopath/directory"directory 

Note: This will reset on every new Terminal window or system restart.

To be persistent, paste the code below in your .zshrc or .bashrc file according to your shell. Those files in your Home Directory. It will be like below.

export PATH="pathPATH=path/to/some/other/place/composer/for/example"example export GOPATH="pathGOPATH=path/to/your/gopath/directory"directory export PATH="$PATHPATH=$PATH:$GOPATH/bin"bin 

Shortest and current solution.

Write this code in Terminal.

export GOPATH="path/to/your/gopath/directory" 

Note: This will reset on every new Terminal window or system restart.

To be persistent, paste the code below in your .zshrc or .bashrc file according to your shell. Those files in your Home Directory. It will be like below.

export PATH="path/to/some/other/place/composer/for/example" export GOPATH="path/to/your/gopath/directory" export PATH="$PATH:$GOPATH/bin" 

Shortest and current solution.

Write this code in Terminal.

export GOPATH=path/to/your/gopath/directory 

Note: This will reset on every new Terminal window or system restart.

To be persistent, paste the code below in your .zshrc or .bashrc file according to your shell. Those files in your Home Directory. It will be like below.

export PATH=path/to/some/other/place/composer/for/example export GOPATH=path/to/your/gopath/directory export PATH=$PATH:$GOPATH/bin 
made it more clear and added extra example
Source Link
atilkan
  • 5.1k
  • 1
  • 33
  • 36

Shortest and current solution.

Write this code in Terminal.

export GOPATH="path/to/your/projectgopath/directory" 

Note: This will reset on every new Terminal window or system restart.

To be persistent, paste the code below in your .zshrc or .bashrc file according to youyour shell. Those files in your Home Directory. It will be like below.

export PATH="path/to/some/other/place/composer/for/example" export GOPATH="path/to/your/gopath/directory" export PATH="$PATH:$GOPATH/bin" 

Shortest and current solution.

Write this code in Terminal.

export GOPATH="path/to/your/project/directory" 

Note: This will reset on every new Terminal window or system restart.

To be persistent, paste the code in your .zshrc or .bashrc file according to you shell. Those files in your Home Directory.

Shortest and current solution.

Write this code in Terminal.

export GOPATH="path/to/your/gopath/directory" 

Note: This will reset on every new Terminal window or system restart.

To be persistent, paste the code below in your .zshrc or .bashrc file according to your shell. Those files in your Home Directory. It will be like below.

export PATH="path/to/some/other/place/composer/for/example" export GOPATH="path/to/your/gopath/directory" export PATH="$PATH:$GOPATH/bin" 
added 1 character in body
Source Link
atilkan
  • 5.1k
  • 1
  • 33
  • 36
Loading
added 40 characters in body
Source Link
atilkan
  • 5.1k
  • 1
  • 33
  • 36
Loading
Source Link
atilkan
  • 5.1k
  • 1
  • 33
  • 36
Loading