Navigate to Interface from Implementing Struct in GoLand

Viewed 267

Go by itself does not have any explicit way of specifying the interface name with the implementations. But do IDEs like GoLand have a way to figure out the interface that a struct is implementing?

2 Answers

Yes, GoLand will allow you to jump to the interface that a struct implements. It works in the inverse too; it'll show you all of the types that implement an interface.

enter image description here

Using the keyboard shortcut Ctrl + T or Ctrl + ALT + B in Windows to display the pop-up box, you can choose whether to jump to the interface or implement it. You can set your own keyboard shortcuts: Settings-> keyboard mapping-> Navigation-> go to implementation enter image description here

Related