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

使用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

图片转代码服务由CSDN问答提供 功能建议

我正在尝试使用 godep 来安装我的依赖项,但我似乎无法 使它工作。 运行GODEP初始化时,出现以下错误

determineProjectRoot:/ home / cjds / development / core / data-service不在任何$ GOPATH中

但是我的GOPATH肯定包含该路径。 这是我的全部路径

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

执行安装导致以下错误,这可能是问题的根源:

/ home / cjds中没有可构建的Go源文件 / development / core / data-service

但是文件夹结构具有 src 文件夹,然后具有 main 文件夹,然后是我的整个Go项目

-/ 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.

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题