dqf98772 2014-11-12 08:12
浏览 41
已采纳

使用Godep的多个项目的单个或多个路径

Currently I'm using godep for package vendoring for Go. The problem is that I'm working on multiple projects depending on different versions of a certain package. I can't decide how to structure my GOPATH(s). I have several options:

  • Use a single GOPATH and use godep restore when switching between projects. The different versions of the certain package will be switched.
  • Use a GOPATH per project and only use godep restore when needed.

Which option is recommended and why?

  • 写回答

2条回答 默认 最新

  • duanbipu1720 2014-11-12 09:13
    关注

    I'm working on multiple projects depending on different versions of a certain package

    Then I would recommend a GOPATH per project, in order to better isolate each dependencies, and make sure there isn't any mix_up in said dependencies.

    Within each GOPATH, you still can use the dependency manager of your choice.

    I use that even with vendoring (just to be sure to get an independent workspace)

    For vendoring, (Go 1.5+), I use govendor, typically:

    govendor fetch +m
    

    Pull in new dependencies or update existing dependencies directly from remotes with govendor fetch.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?