<p>I was hoping to find a way to essentially reverse a package import, to find any public package that imports another package. I took a look at godoc.org figuring it might have a graph of sorts but no luck.</p>
<p>The reason I want to do this is b/c I've found a package that I'd like to use but the documentation is a bit lacking. I was hoping that based on figuring out who else is using this package I can stroll through their code and learn from that instead.</p>
<hr/>**评论:**<br/><br/>averagesecurityguy: <pre><p>Something like this?
<a href="https://godoc.org/crypto/rand?importers" rel="nofollow">https://godoc.org/crypto/rand?importers</a></p></pre>daenney: <pre><p>Exactly that, thanks a bunch.</p>
<p>How did you figure that out?</p>
<p>Argh nvm, found it in the footer. Can't believe I missed that. Thanks again!</p></pre>dchapes: <pre><p>Not what you're looking for since it only looks in <code>$GOPATH</code>, but related and highly useful:</p>
<pre><code>go list -f '{{.ImportPath}} {{join .Imports " "}}' ... | digraph reverse `go list`
</code></pre>
<p>Where digraph is <code>golang.org/x/tools/cmd/digraph</code>.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传