学习地址:https://www.imooc.com/video/20215
版本信息
1 2 3
| golang 1.12 gin 1.4.0 goland
|
快速开始
安装gin
1 2 3 4 5 6 7 8 9
| yujiang@yujiangdeMacBook-Pro-13 ~ % mkdir -p $GOPATH/src/github.com/lnsyyj/go_test_project yujiang@yujiangdeMacBook-Pro-13 ~ % cd $_ yujiang@yujiangdeMacBook-Pro-13 go_test_project %
yujiang@yujiangdeMacBook-Pro-13 go_test_project % export GO111MODULE=on yujiang@yujiangdeMacBook-Pro-13 go_test_project % go mod init go: creating new go.mod: module github.com/lnsyyj/go_test_project
yujiang@yujiangdeMacBook-Pro-13 go_test_project % go get -v github.com/gin-gonic/gin@v1.5
|
快速开始
使用goland,打开/Users/yujiang/go/src/github.com/lnsyyj/go_test_project刚刚创建的项目。启用Enable Go Modules(vgo) integration,如果不启用会找不到刚刚下载的类库。