Content-Disposition: form-data; name="file"; filename="SKILL.md"
Content-Type: application/octet-stream
name: go-install
version: 1.0.0
description: Install Go compiler on Linux for Go project compilation and testing
Install Go compiler on Linux for Go project development, compilation, and testing.
uname -m
# x86_64 = amd64
# aarch64 = arm64
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
export PATH=$PATH:~/go-sdk/bin
export GOPATH=~/go
export GOROOT=~/go-sdk
Add to ~/.bashrc or ~/.profile:
echo 'export PATH=$PATH:~/go-sdk/bin' >> ~/.bashrc
echo 'export GOPATH=~/go' >> ~/.bashrc
echo 'export GOROOT=~/go-sdk' >> ~/.bashrc
go version
go env GOPATH GOROOT
# Run tests
go test ./...
# Run tests with verbose output
go test ./... -v
# Build project
go build -o <output> ./cmd/<entry>
# Download dependencies
go mod download
# Tidy dependencies
go mod tidy
| Item | Value |
|---|---|
| ------ | ------- |
| Download Size | ~65MB |
| Extracted Size | ~300MB |
| Memory | 512MB minimum |
| CPU | Single core sufficient |
| Version | Description |
|---|---|
| --------- | ------------- |
| go1.22.x | LTS stable (recommended) |
| go1.21.x | Previous stable |
| go1.23.x | Latest |
Download: https://go.dev/dl/
共 1 个版本