Installing packages in a local directory

后端 未结 4 1174
野的像风
野的像风 2021-02-01 21:59

What is the best practice to install packages (those with go get...) in a local directory?

Example: I\'d like to try out the Revel web framework, but I don\

4条回答
  •  太阳男子
    2021-02-01 22:22

    To expand on keks answer, you can update your .bashrc to look like this

    export GOROOT=/usr/local/go
    export GOPATH=~/workspace/me/go
    export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
    

    Now all packages installed with go get are separate from the go distribution.

提交回复
热议问题