英文:
How do you quickly find the implementation(s) of an interface in Golang?
问题
让我们假设我想找到所有实现了io.ReadCloser接口的代码。
在Go语言中,我该如何做到这一点?
英文:
Let's say I want to find all implementations of the io.ReadCloser interface.
How can I do this in Go?
答案1
得分: 20
2015年:你可以使用以下方法:
- go oracle implements 命令(更近期的是2022年的
go guru,可以在这里看到) go types Implements()函数(曾经被 Sourcegraph 使用过)
你还可以使用以下工具:
-
dominikh/implements(也使用了go types) -
fzipp/pythia,一个基于浏览器的用户界面(使用了go oracle)
英文:
2015: You can use:
- the go oracle implements command (more recently, 2022,
go guru, as seen here) - the
go types Implements()function (which was used by Sourcegraph at one time)
You also have:
-
dominikh/implements(usesgo typesas well) -
fzipp/pythia, a browser based user interface (usesgo oracle)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论