go开发环境安装

  1. go开发环境下载:https://golang.google.cn/dl/
  2. 配置环境变量
    GOROOT:SDK安装路径
    PATH:添加SDK的bin目录
    GOPATH:工作目录
  3. 设置国内源
    设置国内代理:go env -w GOPROXY=https://goproxy.io,direct
    使用Go Modules的Vendor模式:  go env -w GO111MODULE=on
    go mod 命令:
    go mod tidy (
    1. 引用项目需要的依赖增加到go.mod文件。
    2. 去掉go.mod文件中项目不需要的依赖
    )
     go mod vendor : Go 语言模块系统中的一个命令,用于将项目依赖的所有模块(库)复制到项目目录下的 `vendor` 文件夹中
  4. vs code下载:https://code.visualstudio.com/
  5. vs code 安装go插件
    1. vs code安装vscode-go-syntax 插件
    2. 按下 Ctrl + Shift + X 打开扩展商店(或者点击界面左侧的扩展图标)。

    3. 在搜索框中输入 vscode-go-syntax

  6. 使用手册“:https://tour.go-zh.org/welcome/1
posted @ 2024-04-25 19:16  你看起来真的很好吃  阅读(3)  评论(0编辑  收藏  举报