Reputation: 404
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?
Upvotes: 5
Views: 1135
Reputation: 1
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
Upvotes: 0
Reputation: 438
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.
Upvotes: 9