<p>I guess I have a unique case with my imports and everything. I was able to reproduce the issue here. I need to know if this is intended behavior, and if so, how should I structure my code (dependencies), or if it is a bug I'll have to report it. I get it with dep (0.4.1) and go (1.10.1) on windows (not sure if relevant).</p>
<p>dependency is structured as so.</p>
<p>/dep</p>
<p>/a</p>
<p>/b</p>
<p>dep_test.go</p>
<p>(I'm not sure how spacing will come through with that. dep is root folder and has dep_test.go under it, as well as folders a and b)</p>
<p>a and b both reference <a href="https://github.com/google/uuid" rel="nofollow">github.com/google/uuid</a>(although I'm pretty sure it doesn't matter which library).</p>
<p>When I include that dependency in my project, we'll call it "project", I import a and b as appropriate</p>
<p>import "<a href="https://github.com/me/dep/a" rel="nofollow">github.com/me/dep/a</a>"</p>
<p>import "<a href="https://github.com/me/dep/b" rel="nofollow">github.com/me/dep/b</a>"</p>
<p>and when i build it, I get the build error</p>
<p>cannot use ID (type "dep/vendor/github.com/google/uuid".UUID) as type "project/vendor/github.com/google/uuid".UUID in field value</p>
<p>I didn't know what to google. But I built a test repo here</p>
<p><a href="https://github.com/jasontconnell/uuiddep" rel="nofollow">https://github.com/jasontconnell/uuiddep</a></p>
<p>I'm thinking the 2 packages used throws either go build or dep off (I'm leaning go build a little bit more actually)</p>
<p>PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED</p>
<p><a href="https://github.com/google/uuid" rel="nofollow">github.com/google/uuid</a>0.2 0.2 064e206 0.2 1</p>
<p><a href="https://github.com/jasontconnell/testuuid" rel="nofollow">github.com/jasontconnell/testuuid</a> branch master branch master 0f83cb1 0f83cb1 2</p>
<p>Git clone, dep ensure, go build. If this is a known issue, that's fine, I'll just need a workaround. If it's not I'd like to report it. Thanks for reading! </p>
<hr/>**评论:**<br/><br/>jasontconnell: <pre><p>Reported bug on github repo. They are good about going through that list frequently and thoroughly.</p>
<p><a href="https://github.com/golang/go/issues/25174" rel="nofollow">https://github.com/golang/go/issues/25174</a></p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传