tools / godep

dependency tool for go
http://godoc.org/github.com/tools/godep
BSD 3-Clause "New" or "Revised" License
5.55k stars 455 forks source link

Unable to find dependent package xxx in context of yyy #540

Closed pierrre closed 7 years ago

pierrre commented 7 years ago

Expected behavior

godep save ./... used to work

Actual behavior

I get an error

Unable to find dependent package github.com/pkg/errors in context of /home/pierre/go/src/github.com/<company>/<project>/<subpackage>

But directory $GOPATH/src/github.com/pkg/errors exists.

Steps to reproduce behavior

Update to the latest version of godep. Run godep save ./... in a project without vendor. (same problem with godep update ./...)

godep version output

godep v79 (linux/amd64/go1.8.1) master branch

go version output

go version go1.8.1 linux/amd64

Contents of Godeps.json file

doesn't exist

I did a git bisect, and it was working properly with godep v78.

pierrre commented 7 years ago

Problem solved: There was an empty vendor directory in /home/pierre/go/src/github.com/<company>/<project>. After I remove it, godep works fine. I didn't see it before, because Git doesn't show empty directory...

anaskhan96 commented 7 years ago

@pierrre Thanks that worked for me as well. I was really confused as to where the problem was.