Dimi Ansari
Dimi Ansari

Reputation: 404

Navigate to Interface from Implementing Struct in GoLand

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

Answers (2)

jkpeng
jkpeng

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

disposedtrolley
disposedtrolley

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.

enter image description here

Upvotes: 9

Related Questions