Given pkg foo:
github.com/saml/foo/
src/
saml/
foo/
a.go
.gocfg/
gopaths
vendor.json
vendor/
src/
...
I want to use the package foo in other project, bar.
I want wgo to get package foo under bar's vendor/src/saml/foo
like the following:
github.com/saml/bar/
src/
saml/
bar/
b.go
.gocfg/
gopaths
vendor.json
vendor/
src/
saml/
foo/
a.go
So that bar/b.go can do:
import "saml/foo"
Even if I write bar/.gocfg/vendor.json
as:
{
"GitRepos": {
"vendor/src/saml/foo": {
"URI": "https://github.com/saml/foo/src",
"Ref": "fbf0b2e524306408014c325db63e22749a14319b"
}
},
"MercurialRepos": {}
}
I can't wgo restore
:
restoring "/home/saml/go/src/github.com/saml/bar/vendor/src/saml/foo":
Cloning into '/home/saml/go/src/github.com/saml/bar/vendor/src/saml/foo'...
fatal: repository 'https://github.com/saml/foo/src/' not found
How can I have wgo restore to clone github.com/saml/foo somewhere and put its src/ directory to vendor/src/saml/foo ?
I can solve this if I write package foo as:
github.com/saml/foo/
a.go
...
instead of putting source (a.go
) under src/saml/foo/
.
And, changing bar's vendor.json to:
{
"GitRepos": {
"vendor/src/saml/foo": {
"URI": "https://github.com/saml/foo",
"Ref": "fbf0b2e524306408014c325db63e22749a14319b"
}
},
"MercurialRepos": {}
}