让gin运行起来
运行gin框架过程学习到如下知识点
知识点
go env
查看go环境配置go help [command]
查看命令帮助go env -w [var]
更改环境变量go mod init xxx
初始化模块管理文件(类似于npm init
生成package.json
)go get github.com/gin-gonic/gin
下载包(类似于npm install
)
说明:
GO111MODULE是go的模块化开关,设置为on就可以像npm一样方便的管理管理模块了
GOPROXY可以设置代理,避免被墙,GOPROXY="https://goproxy.cn,direct"