go/install
This commit is contained in:
parent
3150153637
commit
4a8016c4a9
@ -78,6 +78,7 @@ module.exports = {
|
|||||||
'/go/': [
|
'/go/': [
|
||||||
'../',
|
'../',
|
||||||
'',
|
'',
|
||||||
|
'install',
|
||||||
'proxy',
|
'proxy',
|
||||||
],
|
],
|
||||||
'/frontend/': [
|
'/frontend/': [
|
||||||
@ -129,6 +130,7 @@ module.exports = {
|
|||||||
collapsable: false, // 可选的, 默认值是 true,
|
collapsable: false, // 可选的, 默认值是 true,
|
||||||
sidebarDepth: 1, // 可选的, 默认值是 1
|
sidebarDepth: 1, // 可选的, 默认值是 1
|
||||||
children: [
|
children: [
|
||||||
|
'/go/install',
|
||||||
'/go/proxy',
|
'/go/proxy',
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
92
docs/go/install.md
Normal file
92
docs/go/install.md
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
# 安装Go环境
|
||||||
|
|
||||||
|
> wandoubaba / 2024-08-29
|
||||||
|
|
||||||
|
截止本文发布时,go的最新版本是`1.23.0`。
|
||||||
|
|
||||||
|
## linux
|
||||||
|
|
||||||
|
### 下载
|
||||||
|
|
||||||
|
```sh
|
||||||
|
wget https://go.dev/dl/go1.23.0.linux-amd64.tar.gz
|
||||||
|
```
|
||||||
|
|
||||||
|
### 删除旧版本
|
||||||
|
|
||||||
|
```sh
|
||||||
|
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.23.0.linux-amd64.tar.gz
|
||||||
|
```
|
||||||
|
|
||||||
|
### 解压安装
|
||||||
|
|
||||||
|
```sh
|
||||||
|
tar zxvf go1.23.0.linux-amd64.tar.gz -C /usr/local/
|
||||||
|
```
|
||||||
|
|
||||||
|
修改环境变量
|
||||||
|
|
||||||
|
```sh
|
||||||
|
touch /etc/profile.d/go.sh
|
||||||
|
vim /etc/profile.d/go.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
文件内容如下,然后保存退出
|
||||||
|
|
||||||
|
```sh
|
||||||
|
export PATH=$PATH:/usr/local/go/bin
|
||||||
|
```
|
||||||
|
|
||||||
|
使环境变量立即生效
|
||||||
|
|
||||||
|
```sh
|
||||||
|
source /etc/profile.d/go.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### 验证安装
|
||||||
|
|
||||||
|
```sh
|
||||||
|
go version
|
||||||
|
```
|
||||||
|
|
||||||
|
结果应该是
|
||||||
|
|
||||||
|
```txt
|
||||||
|
go version go1.23.0 linux/amd64
|
||||||
|
```
|
||||||
|
|
||||||
|
## mac
|
||||||
|
|
||||||
|
### 下载
|
||||||
|
|
||||||
|
Intel平台
|
||||||
|
|
||||||
|
```sh
|
||||||
|
wget https://go.dev/dl/go1.23.0.darwin-amd64.pkg
|
||||||
|
```
|
||||||
|
|
||||||
|
Arm平台
|
||||||
|
|
||||||
|
```sh
|
||||||
|
wget https://go.dev/dl/go1.23.0.darwin-arm64.pkg
|
||||||
|
```
|
||||||
|
|
||||||
|
### 安装
|
||||||
|
|
||||||
|
直接在Finder中执行pkg文件,或者在终端中用命令
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo installer -pkg go1.23.0.darwin-amd64.pkg -target /usr/local/
|
||||||
|
```
|
||||||
|
|
||||||
|
### 验证安装
|
||||||
|
|
||||||
|
```sh
|
||||||
|
go version
|
||||||
|
```
|
||||||
|
|
||||||
|
结果应该是
|
||||||
|
|
||||||
|
```txt
|
||||||
|
go version go1.23.0 linux/amd64
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user