【问题标题】:Cannot find vendored package in VS Code在 VS Code 中找不到 vendored 包
【发布时间】:2018-10-31 04:55:13
【问题描述】:

使用 go go1.10.2 darwin/amd64 和 glide 0.13.1。依赖项位于供应商目录中。从命令行构建没有错误。在VS Code中查看代码时,显示如下错误:

在以下任何地方都找不到包“github.com/xxx/go-utility/log”:

/usr/local/Cellar/go/1.10.2/libexec/src/github.com/xxx/go-utility/log(来自$GOROOT) /Users/martin/go/src/github.com/xxx/go-utility/log(来自 $GOPATH)

终端和 VS 控制台报告 GOPATH="/Users/martin/go"

如果我发出 go get,我希望我可以让消息消失,但这违背了供应商目录的目的。

这是在新计算机上的全新安装。

我忘记了什么配置?

【问题讨论】:

  • 你的项目代码和供应商目录在哪里?
  • /Users/martin/go/src/xxxdc.visualstudio.com/enlightcentre/reports/backend
  • /Users/martin/go/src/xxxdc.visualstudio.com/enlightcentre/reports/backend/vendor/github.com/xxx/go-utility
  • 乍一看似乎是正确的,您确定该路径中没有符号链接吗? (您可以在项目目录中使用pwd -P 快速查看,应该与上面的路径完全匹配)?
  • 是的,路径中有符号链接

标签: go visual-studio-code glide-golang


【解决方案1】:

根据 vscode-go github 问题 1587 的报告,我的解决方案是将以下内容添加到用户设置中(代码 > 首选项 > 设置)

{ "search.useIgnoreFiles": false }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-05-31
    • 2021-05-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-20
    相关资源
    最近更新 更多