无法导入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
发布于 2021-09-14 10:20:00
看起来你没有在"go get“之前运行"go mod init”。
在cmd中,尝试执行以下操作:
cd [the dir of your source code]go mod initgo get github.com/gorilla/mux有关更多信息,请运行:go help mod
之后,您可能还需要重新启动VS Code。
https://stackoverflow.com/questions/68949545
复制相似问题