It's not who you are underneath, it's what you do that defines you

Brick walls are there for a reason :they let us prove how badly we want things

golang自举编译

#下载对应平台的sdk

wget https://storage.googleapis.com/golang/go1.14.1.linux-amd64.tar.gz

tar -zvxf go1.14.1.linux-amd64.tar.gz

# 重命名

mv go go14

# 下载源码,此地址可能很慢

wget https://storage.googleapis.com/golang/go1.14.1.src.tar.gz

tar -zvxf go1.14.1.src.tar.gz

# 设置环境变量,$HOME为上面的源码解压的地址

export GOPATH=$HOME/go

export GOROOT=$HOME/go

export GOBIN=$HOME/go/bin

export GOARCH=amd64

export GOOS=linux

# 设置,自举编译器路径

export GOROOT_BOOTSTRAP=$HOME/go14

# 跳转目录

cd $HOME/go/src

# 开始编译

./all.bash

# 最终构建出来的sdk在$HOME/go/bin下面的可执行二进制文件

posted @ 2021-10-26 11:00  gbat  阅读(138)  评论(0编辑  收藏  举报

It's not who you are underneath, it's what you do that defines you

Brick walls are there for a reason :they let us prove how badly we want things