--- tags: Golang-multiversion-windows --- # Golang 多版本 Windows contributed by < `shino wu` > ## 安裝 go 版本管理器 - Releases: https://github.com/voidint/g/releases 1. 若使用 Windows 環境以及 x64 CPU, 下載圖中框選的 zip ![image](https://hackmd.io/_uploads/r16ktjgNp.png) 2. 解壓縮至你想放置的資料夾(解壓縮後的資料夾改名為 g) - 範例路徑: C:\Users\shino_wu\Documents\g - 路徑底下會有 g.exe ![image](https://hackmd.io/_uploads/Hy0kcixV6.png) 3. 設定 Windows 環境變數 a. ![image](https://hackmd.io/_uploads/S1Kj5jeEp.png) b. ![image](https://hackmd.io/_uploads/BJmCcox4T.png) c. 紅框選取的部分皆要設定 ![image](https://hackmd.io/_uploads/BkIfnigET.png) 4. 開啟 cmd - 輸入以下指令 ``` g -help ``` ![image](https://hackmd.io/_uploads/SJ3d3seN6.png) 5. 安裝 go - 輸入以下指令, 此範例安裝 go 1.20.6 以及 go 1.18.10 ``` g install 1.20.6 g install 1.18.10 ``` 6. 顯示環境有哪些 go version ``` g ls ``` ![image](https://hackmd.io/_uploads/SklRpig4a.png) 7. 確認當前使用的 go 版本 ``` go version ``` ![image](https://hackmd.io/_uploads/rytZ0il4T.png)