Does anyone know of any tutorials on how to use dep, Go's experimental package manager?

xuanbao · · 602 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;ve been really struggling with getting it going and I&#39;d like to take advantage of the tool.</p> <hr/>**评论:**<br/><br/>Testiclese: <pre><p>Wasn’t the README.md clear? I don’t remember having any difficulty with it. From memory: ‘dep init’ once to initialize your project for use with dep. ‘dep ensure -add’ to vendor a package. ‘dep ensue’ to restore (if you don’t check in your vendor dir) or ‘dep ensure -update’ to update vendored packages. There’s also a ‘dep ensure -prune’ command to remove unneeded dependencies. </p></pre>tristan957: <pre><p>I am getting a few errors:</p> <pre><code>init failed: unable to determine the import path for the root project /home/tristan957/Desktop/dep: /home/tristan957/Desktop/dep is not within any GOPATH/src init failed: unable to detect the containing GOPATH: /home/tristan957/Desktop/dep is not within a known GOPATH/src </code></pre> <p>My folder structure is like this root/src/hound/</p></pre>sheepdog69: <pre><p>Do you have your GOPATH set?</p> <p>Go expects things (source code and libraries) to be in a particular place in relationship to GOPATH. Take a look <a href="https://github.com/golang/go/wiki/GOPATH" rel="nofollow">here</a> for some background.</p> <p>EDIT: Nevermind. I see that <a href="/u/shovelpost" rel="nofollow">/u/shovelpost</a> helped you out.</p></pre>condanky: <pre><p>What have you been struggling with in particular? I can help you workout some of the issues you may be running into, I just need to know where you are getting stuck!</p></pre>tristan957: <pre><p>I have been struggling with the GOPATH and initializing</p> <p>I am getting a few errors:</p> <pre><code>init failed: unable to determine the import path for the root project /home/tristan957/Desktop/dep: /home/tristan957/Desktop/dep is not within any GOPATH/src init failed: unable to detect the containing GOPATH: /home/tristan957/Desktop/dep is not within a known GOPATH/src </code></pre> <p>My folder structure is like this root/src/hound/.</p></pre>shovelpost: <pre><p>Put your code under <code>$GOPATH/src</code>, dep under <code>$GOPATH/bin</code> and everything will work. Please read <a href="https://golang.org/doc/code.html" rel="nofollow">How to Write Go Code</a>.</p></pre>tristan957: <pre><p>Oh now I get it. Thanks</p></pre>

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

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