Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not in any GOPATH while using dep init

Tags:

go

godeps

I'm trying to use godep to install my dependencies but I can't seem to get it to work. When I run GODEP init, I get the following error

determineProjectRoot: /home/cjds/development/core/data-service not in any $GOPATH

But my GOPATH definitely contains that path. This is my whole go path

/home/cjds/development/core/data-service

go install causes the following error, which may be the root of the problem:

no buildable Go source files in /home/cjds/development/core/data-service

The folder structure however has a src folder, and then a main folder and then my whole Go project

-/home/cjds/development/core/data-service/src/main/my-go-files.go

like image 578
cjds Avatar asked Mar 10 '23 00:03

cjds


1 Answers

Your GOPATH points to a root directory containing bin, pkg, and src subdirectories, with project source under src. Tools like godep and go install expect to operate on source, not on your entire GOPATH, so must be run on some path under $GOPATH/src.

like image 117
Adrian Avatar answered Mar 28 '23 07:03

Adrian