golang / dep

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

dep init failed - ubuntu machine #2227

Closed byteshiva closed 4 years ago

byteshiva commented 4 years ago
uname -a 
Linux desktop 5.3.0-25-generic #27-Ubuntu SMP Wed Dec 4 13:36:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

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

dep version
dep:
 version     : devel
 build date  : 
 git hash    : 
 go version  : go1.12.7
 go compiler : gc
 platform    : linux/amd64
 features    : ImportDuringSolve=false

What dep command did you run?

dep init 
init failed: unable to detect the containing GOPATH: /home/xyz/.asdf/installs/golang/1.13.5/packages/src/github.com/sample/example is not within a known GOPATH/src

What did you expect to see?

it should create dependency manager toml file.

What did you see instead?

failed to create one

byteshiva commented 4 years ago

as I'm using golang version manager, I would've to explicitly set GOPATH using below export command.

vim ~/.bashrc

export GOPATH=$(go env GOPATH)

additional notes: I've installed dep using the package version manager asdf, more details available at asdf

   $ asdf plugin-add dep

Now it's working after adding the GOPATH in bash environment.