在Golang的安装过程中遇到了麻烦
因为对于安装相对简单的Linux产生了强烈的兴趣,所以我将其记录下来。
可能有一些错误,但请不要介意。
我在阅读这篇文章时随意安装了一下。
在Linux Mint中安装Golang并编写Hello World程序。
2. 安装派对,开始装入各种东西。
Gore(交互式命令行Shell)
=> REPL。好像是日本制造的。
Delve
=> 调试器。是款新一点的调试器,上面写着“不适合日常使用”。
Hsandbox
=> 类似REPL的东西。不仅支持GO,还支持多种语言如Ruby等。将代码输入编辑器中保存后,在下方的界面中执行。像一个代码备忘录应用程序般的感觉。非常厉害。
安装例如等等的软件
3. 停止运动
不知道为什么,Gore有时候无法顺利运行,有时候可以运行,有时候不能运行。Delve也是一样,有时候可以调用,有时候不能调用。然后,出现了这个错误,无法从Hsandbox调用Go。bin/sh 1: go: not found。但不知为何,实际上go本身是可以运行的(代码的执行没有问题)。
4. 尝试了很多事情后放弃
已经好了,代码已经能够运行了嘛,不需要什么工具给像我这样的新手!我已经放弃了。
5. 令人震惊的事实
apt-get可用吗? 是这样吗?这种情况下重新来过比较快。不管原因是什么,直接删除整个”go”文件夹。
过了一会儿,我注意到版本号是1.2。
当您查看Git时,会发现类似的话题在Debian上通过apt-get安装包的版本为#10095。
Golang debian package installed by sudo apt-get install golang installes version 1.1.2, whereas the current version is 1.4.2.
Can anybody confirm this, and if it is really the case can you please update the repository?
thanks.
意訳: 俺のGolangがapt-getで入れたのに最新の1.4.2じゃなくて1.1.2が入ってる件
We don't have any control over the Debian repositories. You need to bring this up with the Debian maintainers.
Also I think it matters which version of Debian you are using. You didn't mention that.
意訳:メンテやってる中の人に聞けば?
Jessie (testing) has 1.3.3 and it's currently frozen, so even if you wait for the next Stable release you'll get 1.3. Not even Sid (unstable) has 1.4 at the moment.
You can get the latest binary on golang.org, it works just fine on debian.
意訳: あー、それもうメンテされてねぇわ。公式逝け。(;´Д`)
If you want to automate the process of installing from the tarballs here is a fragment of script I originally wrote for the Raspberry Pi. Just use the appropriate URL to get the correct tarball.
意訳: つ俺が使ったインスコ用スクリプト
(以下スクリプト)
wget -O - https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | sudo tar -xzC /usr/local -f -
echo '# Setup for golang' |sudo tee /etc/profile.d/golang.sh
echo 'PATH=$PATH:/usr/local/go/bin'|sudo tee -a /etc/profile.d/golang.sh
source /etc/profile.d/golang.sh
An inoffical ubuntu package (so called PPA) is at https://launchpad.net/~evarlast/+archive/ubuntu/golang1.4
Currently debian sid is frozen, so nothing can be added there either.
If you want to follow the progress, watch https://tracker.debian.org/pkg/golang
意訳: 非公式パッケでいいならでいいならここ
(https://launchpad.net/~evarlast/+archive/ubuntu/golang1.4)
いけばダウソできるお。
所以,将URL设为golang 1.4。
在中国的本地语言中,可以这样表达:
运行 “add-apt-repository” 命令,然后运行 “sudo apt-get install golang” 进行更新。
8. 通行证的事项
指定GOPATH,并创建pkg、src、bin文件夹。
执行go get github.com/some-app,文件将出现在bin文件夹中。
然后,在执行which go命令时,找到的路径(GOROOT),将其加入符号链接即可。
sudo -s ln /home/my_folder/golang/bin/dlv /usr/bin
有一种类似的感觉
所有没有动作的东西,现在大概都动起来了。真是松了一口气。
填補
嘿,顺便一提,Golang和狗朗嘎有点相似呢。
或许可以将其拓展为适合头脑导向的语言哦。
那么,