安装gin时遇到的问题

window安装gin时使用下面的命令报错了

  go get -u github.com/gin-gonic/gin

报错信息:

  go: go.mod file not found in current directory or any parent directory.
  'go get' is no longer supported outside a module.
  To build and install a command, use 'go install' with a version,
  like 'go install example.com/cmd@latest'
  For more information, see https://golang.org/doc/go-get-install-deprecation
  or run 'go help get' or 'go help install'.

解决方案:

  go mod init go.mod  提示下列信息表示生成go.mod文件

  go: creating new go.mod: module go.mod

  go get -u github.com/gin-gonic/gin 使用命令下载gin

posted @ 2022-09-08 10:51  大苟蛋  阅读(672)  评论(0)    收藏  举报