Let's say I want to find all implementations of the io.ReadCloser interface.
How can I do this in Go?
Press Ctrl+F12 or choose Navigate | Implementation(s) from the main menu . Alternatively, you can press Ctrl+Shift+A , start typing the command name in the popup, and then choose it there.
Go language interfaces are different from other languages. In Go language, the interface is a custom type that is used to specify a set of one or more method signatures and the interface is abstract, so you are not allowed to create an instance of the interface.
You can use:
go types Implements()
function (which was used by Sourcegraph at one time)You also have:
dominikh/implements
(uses go types
as well)fzipp/pythia
, a browser based user interface (uses go oracle
)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With