Try   HackMD

Golang 多版本 Windows

contributed by < shino wu >

安裝 go 版本管理器

  1. 若使用 Windows 環境以及 x64 CPU, 下載圖中框選的 zip

    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

  2. 解壓縮至你想放置的資料夾(解壓縮後的資料夾改名為 g)

    • 範例路徑: C:\Users\shino_wu\Documents\g
    • 路徑底下會有 g.exe
      Image Not Showing Possible Reasons
      • The image was uploaded to a note which you don't have access to
      • The note which the image was originally uploaded to has been deleted
      Learn More →
  3. 設定 Windows 環境變數

    a.

    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

    b.
    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

    c. 紅框選取的部分皆要設定
    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

  4. 開啟 cmd

    • 輸入以下指令
    ​​​​g -help
    

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

5. 安裝 go
- 輸入以下指令, 此範例安裝 go 1.20.6 以及 go 1.18.10

g install 1.20.6
g install 1.18.10
  1. 顯示環境有哪些 go version
g ls

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

7. 確認當前使用的 go 版本

go version

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →