Go dep and forks of libraries

后端 未结 1 1078
别那么骄傲
别那么骄傲 2021-01-27 23:50

I\'m trying to understand how to work with Golang and forks. The situation is the following, I\'m writing a library project which depends on library github.co

相关标签:
1条回答
  • 2021-01-28 00:00

    If you look at the help you will see this:

    <import path>[:alt source URL][@<constraint>]
    

    So to add github.com/foo/bar from location github.com/fork/bar you have to add it like this:

    dep ensure -add github.com/foo/bar:github.com/fork/bar
    

    The source location will be added as source attribute in the Gopkg.toml.

    Gopkg docs for dependency rules constraint and override

    0 讨论(0)
提交回复
热议问题