vgo and "local" libraries

blov · · 770 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I am doing some tests with vgo and I can&#39;t get a local library to work correctly</p> <p>The application code layout is like so:</p> <pre><code>$GOPATH/src/app-repo - bin1 - main.go - bin2 - main.go - lib - foo.go </code></pre> <p>Both bin packages are meant to be compiled and use the lib package (via <code>import &#34;app-repo/lib&#34;</code>).</p> <p>Using the basic instructions for vgo, it (rightfully) complains about bad urls.</p> <p>Is there a way to &#34;point&#34; vgo to these modules, or a way to make vgo import over a git+ssh connection (literally the only thing I miss from node/npm)?</p> <p>EDIT: note that the layout above is how the app is currently. For my tests I made a simple mock app outside the <code>$GOPATH</code></p> <p>EDIT 2: I followed <a href="https://gist.github.com/shurcooL/6927554" rel="nofollow">this</a> to get my dependency over ssh with my ssh key and that works for regular <code>go get</code> but <code>vgo build</code> fails with </p> <pre><code>vgo: resolving import &#34;my-repo/vgo-test/lib&#34; vgo: import &#34;testgroup/bin1&#34; -&gt; import &#34;my-repo/vgo-test/lib&#34;: module root is &#34;my-repo/vgo-test&#34; </code></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

770 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传