我想知道是否有一种方法可以自动下载所有导入。
因此,假设我需要在我的代码库中使用 github.com/gorilla/mux
和其他几个包。我应该手动转到我的 ~/go/src
并运行 go get repo
还是有更智能的依赖管理方法。我正在使用 Goland IDE 进行开发。
最佳答案
if there is a way to automatically download all the imports
您可以通过从命令行运行 go get
下载所有导入的 pkg 及其依赖项。
I am using Goland IDE for my development
我也在使用 Goland。当找不到导入时(即导入路径以红色突出显示),您可以将键入插入符放在它上面并按 alt + enter
并选择 go get ...
从弹出窗口自动导入。
关于go - 自动导入 3rd 方包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52939473/