Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

dep does not currently support using GOPATH/src as the project root #836

Closed
mattdee123 opened this issue Jul 16, 2017 · 1 comment
Closed

Comments

@mattdee123
Copy link

I am trying to get dep setup for my company's repo, but I ran into the issue that I cannot init dep at GOPATH/src.

However, it is not immediately clear why this would no be allowed. What is the issue?

For reference, here is our current setup that seems to be unsupported:

We have one monorepo, with our go code at $REPO/go/src. When fetching 3rd-party dependencies, we place them in ~/go_third_party/src. Then we set our GOPATH=\~/go_third_party;$REPO/go/src.

I would love to move to using dep with vendoring, and it seems like the most logical thing to do would be to create a Gopkg.toml/lock file at $REPO/go/src. Trying this fails with:

root project import: dep does not currently support using GOPATH/src as the project root

So, my 2 questions would be:

1: why is this not allowed?
2: what would you recommend as a way around this? We would really rather have one consistent set of dependencies across the company, so creating a separate .toml/.lock file for each subdirectory is not ideal.

@sdboyer
Copy link
Member

sdboyer commented Jul 18, 2017

hi! thanks for the issue 😄

The reason for not currently supporting it are somewhat arcane and detailed; they're covered in #313, particularly #313 (comment). It's not an unsolvable problem, though, and we had someone at the Gophercon community day hackathon start tackling it. The canonical issue for it is #417.

(closing this as dup)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants