Dep混淆了供应商中的项目与GOPATH中的项目

I have projectA which imports packages from projectB. Both are existing in the GOPATH. I use dep for dependency management and projectB is added as a dependency in the Gopkg.toml of the projectA.

If I clear this projectB from the vendor directory of projectA or if I add it explicitly to the ignored = ["projectB"] It compiles fine. Otherwise I get the kind of following errors:

"gitlab.internal.com/client/vendor/gitlab.internal.com/runtime/protocol/client".Connector does not implement "gitlab.internal.com/runtime/protocol/client".Connector (wrong type for ApplicationContext method)
        have ApplicationContext() *"gitlab.internal.com/client/vendor/gitlab.internal.com/runtime/core".ApplicationContext
        want ApplicationContext() *"gitlab.internal.com/runtime/core".ApplicationContext

The only difference from the 'have' and 'want' packages above is the path from where it is coming from. (One from GOPATH, the other from vendor/ of the projectA, which has this compilation issue)

I have the following questions:

  1. Why is GOPATH being searched at all, given it is available in the vendor/? (Why does it state it 'wants' the dependency only from this place!?)
  2. Is there a way to get the dep pick the dependency explicitly from vendor/?

Deleting the projectB from the GOPATH doesn't solve the problem either. What is the issue here?