首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我应该如何用gorilla/mux解决这个导入问题?

我应该如何用gorilla/mux解决这个导入问题?
EN

Stack Overflow用户
提问于 2021-08-27 07:31:36
回答 1查看 111关注 0票数 0

无法导入github.com/gorilla/mux (在任何C:\Program Files\Go\src\github.com\gorilla\mux (来自$GOROOT) C:\Users\lenovo\go\src\github.com\gorilla\mux (来自$GOPATH)中找不到包"github.com/gorilla/mux“)compilerBrokenImport

我已经使用命令"go get github.com/ gorilla / mux“安装了gorilla mux,但是我收到了这个错误。enter image description here

EN

回答 1

Stack Overflow用户

发布于 2021-09-14 10:20:00

看起来你没有在"go get“之前运行"go mod init”。

在cmd中,尝试执行以下操作:

  1. cd [the dir of your source code]

  1. go mod init

  1. go get github.com/gorilla/mux

有关更多信息,请运行:go help mod

之后,您可能还需要重新启动VS Code。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68949545

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档