# 使用 Homebrew, apk, chocolatey, MacPorts, Nix, pacman, zypper, dnf, scoop, winget 安装 go

查看 go 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:go
```

## 代理安全回答

go builds and runs binaries that can access project files, modules, and release workflows.

- **凭据访问:** Reads environment variables, private module credentials, Git credentials, and project config.
- **远程变更:** Can run tools that call cloud, Git, or deployment APIs.
- **发布/制品风险:** Can produce release binaries and publish modules or container images via scripts.
- **推荐控制:** Gate release, private-module, and deployment commands.
- **代理使用指南:** Allow build/test commands; require approval for release publishing and credentialed module operations.

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install go
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install go
```

  证据: MacPorts ports tree: lang/go/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add go
```

  证据: Alpine Linux edge package indexes: go from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#go
```

  证据: nixpkgs package indexes: go from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S go
```

  证据: Arch Linux sync databases: go from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install go
```

  证据: openSUSE Tumbleweed package metadata: go from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

- dnf (92%):

```sh
sudo dnf install golang
```

  证据: Fedora Rawhide package metadata: golang from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

### Windows

- Chocolatey (92%):

```sh
choco install go
```

  证据: Chocolatey community package catalog: go from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','gitextensions'

- Scoop (92%):

```sh
scoop install main/go
```

  证据: Scoop official bucket manifest trees: bucket/go.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id GoLang.Go -e
```

  证据: Windows Package Manager source index: GoLang.Go from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:go
- **软件包管理器:** Homebrew
- **版本:** 1.26.5
- **来源摘要:** Open source programming language to build simple/reliable/efficient software
- **主页:** <https://go.dev/>
- **最后更新:** 2026-07-08T03:14:15Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- go (别名)
- gofmt (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.26.5
## 项目历史与用法

Go is an open source programming language, compiler, standard library, formatter, and command-line toolchain distributed through the go and gofmt executables.

### 项目历史

Go was designed at Google beginning in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson to improve programming productivity for multicore, networked machines and large codebases. The project was launched to the public on 10 November 2009 as an open source language focused on simplicity and efficiency.

Go 1 was released on 28 March 2012 and established the compatibility promise that programs written for Go 1 should continue to compile and run under later Go 1 releases. That stability turned the experimental public release into a predictable platform for application code, libraries, and distribution packaging.

### 采用历史

The Go team described strong early community growth after the 2009 launch, including external contributors, mailing-list activity, and adoption both inside Google and by outside companies. By the project's tenth anniversary, Go's official blog described adoption across cloud infrastructure, naming Docker, Etcd, Istio, Kubernetes, Prometheus, and Terraform as examples of core cloud software written in Go.

### 使用方式

Practitioners use the go command to create modules, fetch dependencies, build, test, install commands, run programs, and maintain go.mod and go.sum files. A module's go.mod file defines the module path, Go version, and dependency requirements, while Go commands such as go mod tidy and go get keep those requirements consistent.

Go's toolchain model made the package more than a compiler binary. The distribution includes the go command plus a bundled toolchain made up of the standard library, compiler, assembler, and other tools; beginning with Go 1.21, the go command can also select or download toolchains according to go and toolchain lines in a module or workspace.

### 为什么软件包爱好者会关心

The brew:go formula is a foundational language-runtime package on macOS and Linux because it installs the canonical go command and gofmt formatter used to build Go software and many other Homebrew formulas from source.

### 时间线

- 2007: Go design work began at Google.
- 2009: Go was launched as an open source project.
- 2012: Go 1 was released with the long-term compatibility promise.
- 2018: Go 1.11 introduced preliminary module support.
- 2021: Go 1.16 made module-aware mode the default and added //go:embed.
- 2023: Go 1.21 introduced automatic toolchain selection in the go command.

### Related projects

- Go's ecosystem includes pkg.go.dev, the standard library, the module proxy and checksum database, the x/tools repository, and large cloud-native projects such as Kubernetes, Terraform, Prometheus, Docker, Etcd, and Istio.

### 来源

- <https://formulae.brew.sh/formula/go>
- <https://go.dev/blog/10years>
- <https://go.dev/blog/1year>
- <https://go.dev/blog/modules2019>
- <https://go.dev/doc/devel/release>
- <https://go.dev/doc/modules/gomod-ref>
- <https://go.dev/doc/toolchain>
- <https://go.googlesource.com/go>


## 安全说明

compiler and runtime ecosystem.

- **Geiger 风险:** yellow / 高
- compiler and runtime ecosystem
- **审批门规则:** 7

## 其他软件包管理器记录

- Nix - go: normalized package name match | nixpkgs package indexes: go from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- apk - go - 1.26.5-r0: normalized package name match | Alpine Linux edge package indexes: go from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Go programming language compiler | https://go.dev/
- apk - go-doc - 1.26.5-r0: normalized package name match | Alpine Linux edge package indexes: go-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Go programming language compiler (documentation) | https://go.dev/
- dnf - golang - 1.27~rc2-2.fc45: normalized package name match | Fedora Rawhide package metadata: golang from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | The Go Programming Language | https://go.dev
- pacman - go - 2:1.26.5-1: normalized package name match | Arch Linux sync databases: go from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Core compiler tools for the Go programming language | https://go.dev/
- zypper - go - 1.26-2.3: normalized package name match | openSUSE Tumbleweed package metadata: go from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A compiled, garbage-collected, concurrent programming language | http://golang.org
- zypper - go-doc - 1.26-2.3: normalized package name match | openSUSE Tumbleweed package metadata: go-doc from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Go documentation | http://golang.org
- zypper - go-race - 1.26-2.3: normalized package name match | openSUSE Tumbleweed package metadata: go-race from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Go runtime race detector | https://compiler-rt.llvm.org/
- zypper - go1.21 - 1.21.13-11.2: normalized package name match | openSUSE Tumbleweed package metadata: go1.21 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A compiled, garbage-collected, concurrent programming language | https://go.dev/
- zypper - go1.22 - 1.22.12-7.2: normalized package name match | openSUSE Tumbleweed package metadata: go1.22 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A compiled, garbage-collected, concurrent programming language | https://go.dev/
- zypper - go1.23 - 1.23.12-6.2: normalized package name match | openSUSE Tumbleweed package metadata: go1.23 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A compiled, garbage-collected, concurrent programming language | https://go.dev/
- zypper - go1.24 - 1.24.13-5.2: normalized package name match | openSUSE Tumbleweed package metadata: go1.24 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A compiled, garbage-collected, concurrent programming language | https://go.dev/
- zypper - go1.25 - 1.25.12-2.2: normalized package name match | openSUSE Tumbleweed package metadata: go1.25 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A compiled, garbage-collected, concurrent programming language | https://go.dev/
- zypper - go1.26 - 1.26.5-2.2: normalized package name match | openSUSE Tumbleweed package metadata: go1.26 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A compiled, garbage-collected, concurrent programming language | https://go.dev/
- zypper - go1.27 - 1.27rc2-1.1: normalized package name match | openSUSE Tumbleweed package metadata: go1.27 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A compiled, garbage-collected, concurrent programming language | https://go.dev/
- MacPorts - go: normalized package name match | MacPorts ports tree: lang/go/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/go.yml](https://github.com/mxcl/pkgdb/blob/main/combined/go.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- approval-gate seed metadata
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
- curated agent safety answer
