如何在Mac OS X上解码要安装的Golang版本?

huangapple go评论74阅读模式
英文:

How to decode which version of Golang to install on Mac OS X?

问题

在官方的Golang网站上,在入门指南部分,我们可以看到以下内容:

安装Go工具

如果你正在升级旧版本的Go,你必须先移除已有的版本。

Linux、Mac OS X和FreeBSD的tarballs

下载压缩包并将其解压到/usr/local目录下,创建一个Go目录在/usr/local/go。例如:

tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz

根据你的安装选择相应的压缩包文件。例如,如果你要安装Go版本1.2.1的64位x86 Linux版本,你需要下载的压缩包文件名为go1.2.1.linux-amd64.tar.gz。

(通常这些命令需要以root用户或通过sudo来运行。)

/usr/local/go/bin添加到PATH环境变量中。你可以通过在/etc/profile(系统范围的安装)或$HOME/.profile中添加以下行来实现:

export PATH=$PATH:/usr/local/go/bin

当我们访问下载部分时,会有很多选项:

go1.4.2

文件名 类型 操作系统 架构 SHA1校验和

go1.4.2.src.tar.gz 源码 460caac03379f746c473814a65223397e9c9a2f6

go1.4.2.darwin-386-osx10.6.tar.gz 压缩包 OS X
10.6+ 32位 fb3e6b30f4e1b1be47bbb98d79dd53da8dec24ec

go1.4.2.darwin-386-osx10.8.tar.gz 压缩包 OS X
10.8+ 32位 65f5610fdb38febd869aeffbd426c83b650bb408

go1.4.2.darwin-386-osx10.6.pkg 安装程序 OS X
10.6+ 32位 3ed569ce33616d5d36f963e5d7cefb55727c8621

go1.4.2.darwin-386-osx10.8.pkg 安装程序 OS X
10.8+ 32位 7f3fb2438fa0212febef13749d8d144934bb1c80

go1.4.2.darwin-amd64-osx10.6.tar.gz 压缩包 OS X
10.6+ 64位 00c3f9a03daff818b2132ac31d57f054925c60e7

go1.4.2.darwin-amd64-osx10.8.tar.gz 压缩包 OS X
10.8+ 64位 58a04b3eb9853c75319d9076df6f3ac8b7430f7f

go1.4.2.darwin-amd64-osx10.6.pkg 安装程序 OS X
10.6+ 64位 3fa5455e211a70c0a920abd53cb3093269c5149c

go1.4.2.darwin-amd64-osx10.8.pkg 安装程序 OS X
10.8+ 64位 8fde619d48864cb1c77ddc2a1aec0b7b20406b38

我使用的是Mac OS X Yosemite,版本10.10.3,配置如下:

  • 处理器:2.8 GHz Intel Core i5
  • 内存:8 GB 1600 MHz DDR3
  • 显卡:Intel Iris 1536 MB

我应该安装哪个版本的Go呢?

最重要的是,为什么(这样我可以在将来自己做出决策)?

英文:

On the official Golang website, in the Get Started section, we read:

> Install the Go tools
>
> If you are upgrading from an older version of Go you must first remove
> the existing version.
>
> Linux, Mac OS X, and FreeBSD tarballs
>
> Download the archive and extract it into /usr/local, creating a Go
> tree in /usr/local/go. For example:
>
> tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
>
> Choose the archive
> file appropriate for your installation. For instance, if you are
> installing Go version 1.2.1 for 64-bit x86 on Linux, the archive you
> want is called go1.2.1.linux-amd64.tar.gz.
>
> (Typically these commands must be run as root or through sudo.)
>
> Add /usr/local/go/bin to the PATH environment variable. You can do
> this by adding this line to your /etc/profile (for a system-wide
> installation) or $HOME/.profile:
>
> export PATH=$PATH:/usr/local/go/bin

When we visit the Downloads section, we are presented with many options:

> go1.4.2
>
> File name Kind OS Arch SHA1 Checksum
>
> go1.4.2.src.tar.gz Source 460caac03379f746c473814a65223397e9c9a2f6
>
> go1.4.2.darwin-386-osx10.6.tar.gz Archive OS X
> 10.6+ 32-bit fb3e6b30f4e1b1be47bbb98d79dd53da8dec24ec
>
> go1.4.2.darwin-386-osx10.8.tar.gz Archive OS X
> 10.8+ 32-bit 65f5610fdb38febd869aeffbd426c83b650bb408
>
> go1.4.2.darwin-386-osx10.6.pkg Installer OS X
> 10.6+ 32-bit 3ed569ce33616d5d36f963e5d7cefb55727c8621
>
> go1.4.2.darwin-386-osx10.8.pkg Installer OS X
> 10.8+ 32-bit 7f3fb2438fa0212febef13749d8d144934bb1c80
>
> go1.4.2.darwin-amd64-osx10.6.tar.gz Archive OS X
> 10.6+ 64-bit 00c3f9a03daff818b2132ac31d57f054925c60e7
>
> go1.4.2.darwin-amd64-osx10.8.tar.gz Archive OS X
> 10.8+ 64-bit 58a04b3eb9853c75319d9076df6f3ac8b7430f7f
>
> go1.4.2.darwin-amd64-osx10.6.pkg Installer OS X
> 10.6+ 64-bit 3fa5455e211a70c0a920abd53cb3093269c5149c
>
> go1.4.2.darwin-amd64-osx10.8.pkg Installer OS X
> 10.8+ 64-bit 8fde619d48864cb1c77ddc2a1aec0b7b20406b38

I run Mac OS X Yosemite, Version 10.10.3, with the following configuration:

  • Processor: 2.8 GHz Intel Core i5
  • Memory: 8 Go 1600 MHz DDR3
  • Graphics: Intel Iris 1536 Mo

Which version of Go should I install?

And most importantly, why (so that I can make a decision for myself in the future)?

答案1

得分: 5

你会想要这个版本:

> go1.4.2.darwin-amd64-osx10.8.pkg 安装程序 OS X 10.8+ 64位

请注意关键部分:amd64(64位),OS X 10.8+(其中10.10.3满足要求)。这是一个图形界面安装程序,可以自动化很多工作。

Mac OS X通常被称为“darwin”,这是低级操作系统的名称。

英文:

You'll want this one:

> go1.4.2.darwin-amd64-osx10.8.pkg Installer OS X 10.8+ 64-bit

Note the key parts: amd64 (64-bit), OS X 10.8+ (of which 10.10.3 satisfies). It's the GUI installer, which automates a lot of the work.

Mac OS X is often referred to as "darwin", which is the name for the low-level OS.

huangapple
  • 本文由 发表于 2015年7月20日 11:21:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/31508390.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定