golang / dep

Go dependency management tool experiment (deprecated)
https://golang.github.io/dep/
BSD 3-Clause "New" or "Revised" License
12.86k stars 1.05k forks source link

Should read env vars from .dep (feature request) #2184

Closed Tornskaden closed 3 years ago

Tornskaden commented 5 years ago

It makes sense for me to have projects outside of GOPATH and symlink the folders.

I understand you have an env var DEPPROJECTROOT which needs to be set per project. I do not want to remember where the project's folder is symlinked each time I want to run dep status og dep ensure I even want a convenient way to run dep init when outside the GOPATH

Having to run DEPPROJECTROOT=/real/path/to/project/which/I/keep/forgetting dep ensure is inconvenient. So is setting DEPPROJECTROOT in .bashrc or .zshrc when working on more than one project on the same machine.

There may be a smart way to pipe an env var from a file, but my bash mojo is not Jedi enough

My suggestion

Let ´dep´ look for env vars in a .dep file, in the directory and its ancestors. With a DEPPROJECTROOT=/real/path/to/project inside .dep, one can simply run dep init or one of the other commands. With a DEPWORKSPACE=/real/path/to/workspace inside .dep, one can run dep init foobar from the workspace holding local projects.

E.g. in ~/development/playground/golang/foobar the .dep file can contain DEPPROJECTROOT=~/go/src/playground/foobar Or ~/development/playground/golang could hold a .dep file containing DEPWORKSPACE=~/go/src/playground Similarly ~/development/worlddomination/golang could hold a .dep file containing DEPWORKSPACE=~/go/src/github.com/<username>

mvdan commented 3 years ago

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!