@@ -5,33 +5,27 @@ set -ex
55export GOPATH=/opt/go
66export CGO_ENABLED=0
77# change go version if upgrade
8- export GO1_20=go1.20.14 # 当前版本
9- export GO1_23=go1.23.6
10- export GO1_24=go1.24.0
8+ export GO1_23=go1.23.10
9+ export GO1_24=go1.24.4
1110
12- go install golang.org/dl/$GO1_20 @latest
1311go install golang.org/dl/$GO1_23 @latest
1412go install golang.org/dl/$GO1_24 @latest
1513
1614export HOME=/opt/go
17- $GOPATH /bin/$GO1_20 download && rm -rf $GOPATH /sdk/$GO1_20 /$GO1_20 .linux-amd64.tar.gz
1815$GOPATH /bin/$GO1_23 download && rm -rf $GOPATH /sdk/$GO1_23 /$GO1_23 .linux-amd64.tar.gz
1916$GOPATH /bin/$GO1_24 download && rm -rf $GOPATH /sdk/$GO1_24 /$GO1_24 .linux-amd64.tar.gz
2017
2118# 清理下载器
22- rm -rf $GOPATH /bin/$GO1_20
2319rm -rf $GOPATH /bin/$GO1_23
2420rm -rf $GOPATH /bin/$GO1_24
2521
2622# 软链大版本 方便升级
2723cd /opt/go/bin
28- ln -sf /opt/go/sdk/$GO1_20 /bin/go go1.20
2924ln -sf /opt/go/sdk/$GO1_23 /bin/go go1.23
3025ln -sf /opt/go/sdk/$GO1_24 /bin/go go1.24
3126ln -sf /opt/go/sdk/$GO1_23 /bin/go go
3227
3328cd /opt/go/sdk
34- ln -sf $GO1_20 go1.20
3529ln -sf $GO1_23 go1.23
3630ln -sf $GO1_24 go1.24
3731ln -sf $GO1_23 go
@@ -43,27 +37,27 @@ export PATH=$GOPATH/bin:$PATH
4337# cd hack/tools && go1.24 install tool
4438
4539# vscode dev
46- go install golang.org/x/tools/gopls@latest
47- go install github.com/go-delve/delve/cmd/dlv@latest
48- go install github.com/golang/vscode-go/vscgo@latest
49- go install github.com/haya14busa/goplay/cmd/goplay@latest
50- go install github.com/fatih/gomodifytags@latest
51- go install github.com/josharian/impl@latest
52- go install github.com/cweill/gotests/gotests@latest
53- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3
40+ go1.24 install golang.org/x/tools/gopls@latest
41+ go1.24 install github.com/go-delve/delve/cmd/dlv@latest
42+ go1.24 install github.com/golang/vscode-go/vscgo@latest
43+ go1.24 install github.com/haya14busa/goplay/cmd/goplay@latest
44+ go1.24 install github.com/fatih/gomodifytags@latest
45+ go1.24 install github.com/josharian/impl@latest
46+ go1.24 install github.com/cweill/gotests/gotests@latest
47+ go1.24 install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3
5448
5549# protobuf
5650# https://github.com/protocolbuffers/protobuf-go
57- go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0
51+ go1.24 install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0
5852# https://github.com/grpc/grpc-go
59- go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0
60- go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.16.2
61- go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.16.2
53+ go1.24 install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0
54+ go1.24 install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.16.2
55+ go1.24 install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.16.2
6256
6357# my dev
64- go install golang.org/x/perf/cmd/benchstat@latest
65- go install github.com/ifooth/devcontainer/cmd/dev@v0.0.1
66- go install github.com/ifooth/devcontainer/cmd/gen-lint@v0.0.1
58+ go1.24 install golang.org/x/perf/cmd/benchstat@latest
59+ go1.24 install github.com/ifooth/devcontainer/cmd/dev@v0.0.1
60+ go1.24 install github.com/ifooth/devcontainer/cmd/gen-lint@v0.0.1
6761
6862# clean cache
6963rm -rf /opt/go/pkg
0 commit comments