英文:
Install Go from source to custom prefix
问题
我在/usr目录下安装了一个旧版本的Go(使用yum)。如果我从Golang网站下载源代码并运行all.bash,二进制文件和库将安装在下载的目录中。
使用通常的Makefile,可以很容易地设置PREFIX,这个设置可以在all.bash文件的某个地方完成吗?
英文:
I have a Go installation in /usr, which is old (yum). If I download the source from the Golang site and run the all.bash, the binaries and libraries are installed in the downloaded dir.
With a usual Makefile, it's easy to set PREFIX, can this be done in the all.bash file somewhere?
答案1
得分: 1
只要你设置了GOPATH
并将$GOROOT/bin
添加到你的路径中,你就不需要在任何地方“安装”它。
export PATH="$PATH:/usr/src/go/bin"
英文:
You don't need to "install" it anywhere as long as you have GOPATH
set and add $GOROOT/bin
to your path.
export PATH="$PATH:/usr/src/go/bin"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论