Installing packages in a local directory

后端 未结 4 1237
野的像风
野的像风 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:12

    You can export the env variable GOPATH. For me it is ~/local/lib/go. This folder has the subfolders bin, pkg and src, so it's just like /usr/local/go. The go-tool will then automatically download , build and install packages into this directory.

提交回复
热议问题