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

Created on 22 Nov 2018  路  3Comments  路  Source: golang/dep

What version of dep are you using (dep version)? Latest version

What dep command did you run? dep init

What did you expect to see? Successful install

What did you see instead? init failed: unable to determine the import path for the root project /home/raven/go_projects: /home/raven/go_projects is not within any GOPATH/src

Most helpful comment

The way the GOPATH is to be used is to reference the canonical path to your SCM. For example, all of my stuff is at github.com/theckman. That means all of my code lives at $GOPATH/src/github.com/theckman. It's pretty convenient and consistent. I then have projects under there, like $GOPATH/src/github.com/theckman/cronner.

All 3 comments

@angryrobot that's because that structure isn't valid Go. You're supposed to have it exist within one package under src so that it can have a package name. This is a limitation of the Go toolchain, not dep.

The way the GOPATH is to be used is to reference the canonical path to your SCM. For example, all of my stuff is at github.com/theckman. That means all of my code lives at $GOPATH/src/github.com/theckman. It's pretty convenient and consistent. I then have projects under there, like $GOPATH/src/github.com/theckman/cronner.

Dep was officially deprecated earlier this year, and the proposal to archive this repository was accepted. As such, I'm closing outstanding issues before archiving the repository. For any further comments, please use the proposal thread on the Go issue tracker. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rustyx picture rustyx  路  3Comments

rogpeppe picture rogpeppe  路  4Comments

mohanraj-r picture mohanraj-r  路  3Comments

mildred picture mildred  路  3Comments

tapir picture tapir  路  3Comments