{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/12432","labels_url":"https://api.github.com/repos/golang/go/issues/12432/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/12432/comments","events_url":"https://api.github.com/repos/golang/go/issues/12432/events","html_url":"https://github.com/golang/go/issues/12432","id":104244376,"number":12432,"title":"vendor: go build error when in some dependence","user":{"login":"hilyjiang","id":1214867,"avatar_url":"https://avatars.githubusercontent.com/u/1214867?v=3","gravatar_id":"","url":"https://api.github.com/users/hilyjiang","html_url":"https://github.com/hilyjiang","followers_url":"https://api.github.com/users/hilyjiang/followers","following_url":"https://api.github.com/users/hilyjiang/following{/other_user}","gists_url":"https://api.github.com/users/hilyjiang/gists{/gist_id}","starred_url":"https://api.github.com/users/hilyjiang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hilyjiang/subscriptions","organizations_url":"https://api.github.com/users/hilyjiang/orgs","repos_url":"https://api.github.com/users/hilyjiang/repos","events_url":"https://api.github.com/users/hilyjiang/events{/privacy}","received_events_url":"https://api.github.com/users/hilyjiang/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-01T11:25:28Z","updated_at":"2015-09-09T05:53:58Z","closed_at":"2015-09-01T16:55:43Z","body":"I just try to build my project with GO15VENDOREXPERIMENT support with glide.\r\nBut I found there is something wrong when build it.\r\n\r\nCode Tree:\r\n```\r\n# tree \r\n.\r\n├── main.go\r\n└── vendor\r\n    ├── a\r\n    │   └── a.go\r\n    └── b\r\n        ├── b.go\r\n        └── vendor\r\n            └── a\r\n                └── a.go\r\n# find .\r\n.\r\n./vendor\r\n./vendor/b\r\n./vendor/b/b.go\r\n./vendor/b/vendor\r\n./vendor/b/vendor/a\r\n./vendor/b/vendor/a/a.go\r\n./vendor/a\r\n./vendor/a/a.go\r\n./main.go\r\n```\r\n\r\n`vendor/a` and `vendor/b/vendor/a` are same package.\r\n\r\n*vendor/a/a.go*\r\n```go\r\npackage a\r\n\r\ntype T struct {\r\n    Name string\r\n}\r\n\r\nfunc Test() *T {\r\n    return &T{\"a\"}\r\n}\r\n```\r\n\r\n*vendor/b/b.go*\r\n```go\r\npackage b\r\n\r\nimport (\r\n    \"a\"\r\n)\r\n\r\nfunc Test() *a.T {\r\n    return &a.T{\"b\"}\r\n}\r\n```\r\n\r\n*main.go*\r\n```go\r\npackage main\r\n\r\nimport (\r\n    \"a\"\r\n    \"b\"\r\n    \"fmt\"\r\n)\r\n\r\nfunc main() {\r\n    var t1, t2 *a.T\r\n    t1 = a.Test()\r\n    t2 = b.Test()\r\n    fmt.Println(t1, t2)\r\n}\r\n```\r\n\r\nWhen run `go build`, error occur:\r\n```\r\n# go build\r\n# c\r\n./main.go:12: cannot use b.Test() (type *\"c/vendor/b/vendor/a\".T) as type *\"c/vendor/a\".T in assignment\r\n```\r\nIs there other goodway to manage those relationships between packages?\r\nWill `go build` deal `vendor/` specially to meet the use?"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/138792373","html_url":"https://github.com/golang/go/issues/12432#issuecomment-138792373","issue_url":"https://api.github.com/repos/golang/go/issues/12432","id":138792373,"user":{"login":"kostya-sh","id":7126275,"avatar_url":"https://avatars.githubusercontent.com/u/7126275?v=3","gravatar_id":"","url":"https://api.github.com/users/kostya-sh","html_url":"https://github.com/kostya-sh","followers_url":"https://api.github.com/users/kostya-sh/followers","following_url":"https://api.github.com/users/kostya-sh/following{/other_user}","gists_url":"https://api.github.com/users/kostya-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/kostya-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kostya-sh/subscriptions","organizations_url":"https://api.github.com/users/kostya-sh/orgs","repos_url":"https://api.github.com/users/kostya-sh/repos","events_url":"https://api.github.com/users/kostya-sh/events{/privacy}","received_events_url":"https://api.github.com/users/kostya-sh/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T05:53:58Z","updated_at":"2015-09-09T05:53:58Z","body":"@benjboyer the main problem here is that impossible to verify automatically that `vendor/a` and `vendor/b/vendor/a` are compatible with each other (e.g. if they were vendored at different times). Even if these packages are APIs compatible there is no guarantee that behavior hasn't changed. So you should resolve possible conflicts manually. Go cannot do it for you."}}