无法在 vscode 中导入模块

时间:2021-07-03 01:02:48

标签: go

这是 vscode 警告的内容

could not import github.com/gorilla/mux (cannot find package "github.com/gorilla/mux" in any of 
    /usr/local/go/src/github.com/gorilla/mux (from $GOROOT)

这是我通过终端找到的仅有的两个文件夹:

enter image description here

1 个答案:

答案 0 :(得分:0)

尝试在终端中运行以下命令。

go get -u github.com/gorilla/mux

这应该为您创建 src 文件夹