Go 安装

--------------------------80187b9f2f8945b5 Content-Disposition: form-data; name="file"; filename="SKILL.md" Content-Type: application/octet-stream --- name: go-install-zh version: 1.0.0 description: 在 Linux 环境安装 Go 编译器,用于 Go 项目编译和测试 ---

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "Go 安装" with this command: npx skills add solidexu/go-install-zh

--------------------------80187b9f2f8945b5 Content-Disposition: form-data; name="file"; filename="SKILL.md" Content-Type: application/octet-stream


name: go-install-zh version: 1.0.0 description: 在 Linux 环境安装 Go 编译器,用于 Go 项目编译和测试

Go 编译器安装

在 Linux 环境安装 Go 编译器,用于 Go 项目编译和测试。

适用场景

  • Go 项目开发
  • 运行单元测试
  • 编译 Go 程序

安装步骤

1. 确认系统架构

uname -m
# x86_64 = amd64
# aarch64 = arm64

2. 下载并安装

amd64 (x86_64):

cd /tmp
curl -LO https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
tar -xzf go1.22.0.linux-amd64.tar.gz
mv go ~/go-sdk
rm go1.22.0.linux-amd64.tar.gz

arm64 (aarch64):

cd /tmp
curl -LO https://go.dev/dl/go1.22.0.linux-arm64.tar.gz
tar -xzf go1.22.0.linux-arm64.tar.gz
mv go ~/go-sdk
rm go1.22.0.linux-arm64.tar.gz

3. 配置环境变量

export PATH=$PATH:~/go-sdk/bin
export GOPATH=~/go
export GOROOT=~/go-sdk

4. 持久化配置

添加到 ~/.bashrc~/.profile

echo 'export PATH=$PATH:~/go-sdk/bin' >> ~/.bashrc
echo 'export GOPATH=~/go' >> ~/.bashrc
echo 'export GOROOT=~/go-sdk' >> ~/.bashrc

5. 验证安装

go version
go env GOPATH GOROOT

常用命令

# 运行测试
go test ./...

# 运行测试(详细输出)
go test ./... -v

# 编译项目
go build -o <output> ./cmd/<entry>

# 下载依赖
go mod download

# 整理依赖
go mod tidy

资源需求

项目数值
安装包大小~65MB
解压后大小~300MB
内存需求最低 512MB
CPU 需求单核即可

注意事项

  1. Go 无运行时依赖,单二进制文件
  2. 编译速度极快,适合 CI/CD
  3. 建议使用 LTS 版本(如 1.22.x)
  4. GOPATH 目录会自动创建

版本选择

版本说明
go1.22.xLTS 稳定版(推荐)
go1.21.x旧稳定版
go1.23.x最新版

下载地址: https://go.dev/dl/ --------------------------80187b9f2f8945b5--

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Go Install

Install Go 1.22 compiler on Linux, configure environment variables, and provide commands for development, testing, building, and dependency management.

Registry SourceRecently Updated
1010Profile unavailable
General

Go Production Engineering

Expertise in Go project architecture, error handling, concurrency safety, testing, observability, configuration, CI/CD, and documentation for production depl...

Registry SourceRecently Updated
3090Profile unavailable
General

Context Restore

Skill that restores conversation context when users want to "continue where we left off". Reads compressed context files, extracts key information (recent operations, projects, tasks), and provides structured output to help users quickly resume their work.

Registry SourceRecently Updated
1.2K0Profile unavailable
General

Go-To-Market Strategy Framework

Create detailed go-to-market plans covering positioning, channel strategy, pricing, launch timeline, and success metrics for product or market launches.

Registry SourceRecently Updated
4421Profile unavailable