duanchao9559 2019-06-01 16:26
浏览 2143
已采纳

使用Go模块时如何获取依赖项的master分支

I am using Go-modules for a project. When I retrieve the dependency for a package, it retrieves an old release. How can I get the code in the master branch?

  • 写回答

1条回答 默认 最新

  • dongyouji7022 2019-06-01 20:07
    关注

    Use:

    go get foo@master
    
    go get foo@v1.2.3    //for v1.2.3 tag
    go get foo@master    // for master
    go get foo@e3702bed2 // for a specific commit
    

    There are some more details about versioning here:

    https://github.com/golang/go/wiki/Modules#daily-workflow

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

报告相同问题?