<hr/>**评论:**<br/><br/>qu33ksilver: <pre><p>Nope. This was done once, and then rolled back. <a href="https://github.com/golang/go/issues/13078" rel="nofollow">https://github.com/golang/go/issues/13078</a>.</p></pre>dlsniper: <pre><p>No. But you can duplicate what go get does by doing <code>mkdir -p dir/name && cd dir/name && git clone --depth=1 repo .</code></p></pre>FullTimePhilosopher: <pre><p>Correct, you just missed <code>go install</code> =)</p></pre>dlsniper: <pre><p>Not really needed after the first compilation in the Go 1.10+ world, but yes. </p></pre>qrv3w: <pre><p>What do you suggest for doing "go get ./..." inside a repo to install dependencies in a shallow way?</p></pre>qrv3w: <pre><p>I'll answer my own question. Here's <a href="https://github.com/schollz/git-shallow" rel="nofollow">a <30 line program that wraps git</a>. So you can just do:</p>
<p><code>
$ go get github.com/schollz/git
$ export PATH=$GOPATH/bin:$PATH
</code></p>
<p>which will set <code>depth==1</code> whenever you do a pull/clone with git.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传