dongtan6336 2017-05-23 18:20
浏览 76
已采纳

使用dep init时不在任何GOPATH中

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

  • 写回答

1条回答 默认 最新

  • douxian9010 2017-05-23 18:23
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?