dsf4354353452 2016-05-10 17:32
浏览 41
已采纳

Godeps的发展流程?

Bit confused with Godeps in general. Say I'm contributing Go code to a central repository, and now I need to pull the code and contribute my own code changes. What would be the correct godep flow?

Would it be:

git pull  // pull latest master
godep restore // Install the package versions specified in Godeps/Godeps.json to $GOPATH
go get foo/bar  // Get package foo/bar and edit your code to import foo/bar
godep save ./...  // Saves dependencies
// Then, check into source control
  • 写回答

1条回答 默认 最新

  • douye2036 2016-05-10 23:37
    关注

    One option:

    git pull
    godep restore
    go get -u foo/bar // -u updates
    go test ./...
    go run main.go
    godep save ./...
    

    But, I don't like restoring to my GOPATH in disconnected HEAD states of git, since I contribute to several other repos (and have gotten errors in the past with this) directly within my GOPATH.

    So I usually do this:

    git pull
    go get -u foo/bar
    godep update foo/bar
    godep go test ./...
    godep go run main.go
    

    Using godep as a prefix changes the $GOPATH for go-related functions.

    TIP: set all the flags of your main executable with sensible defaults, for all developers. That way they don't need to pass custom parameters just for local development.

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

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度