Martin Flower
Martin Flower

Reputation: 371

Cannot find vendored package in VS Code

Using go go1.10.2 darwin/amd64 together with glide 0.13.1. Dependencies are in the vendor directory. There is no error building from the command line. When viewing the code in VS Code, the following error is displayed:

Cannot find package "github.com/xxx/go-utility/log" in any of:

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

Both the terminal and the VS Console report GOPATH="/Users/martin/go"

I expect that I can make the message go away if I issue a go get, but this defeats the purpose of the vendor directory.

This is a new installation on a new computer.

What configuration have I forgotten?

Upvotes: 1

Views: 4952

Answers (1)

Martin Flower
Martin Flower

Reputation: 371

As reported on vscode-go github issue 1587 my solution was to add the following to user settings (Code > Preferences > Settings)

{ "search.useIgnoreFiles": false }

Upvotes: 2

Related Questions