Appearance
0619-Linux 系统操作恶补
用 g 管理多个 Go 版本
bash
# 先装基础工具
sudo apt update
sudo apt install curl git -y
# 安装 g
curl -sSL https://git.io/g-install | sh -s
# 加载环境
source ~/.bashrc
# 安装指定版本 Go
g install latest
g install 1.24.4
g use 1.24.4
# 验证
go versionhtop
安装 htop
bash
sudo apt update
sudo apt install htopgit 初始化
bash
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
ls -la ~/.ssh/go 初始化
- go mod 中国大陆镜像站 https://goproxy.cn
bash
export GO111MODULE=on
export GOPROXY=https://goproxy.cn