Navigate to Interface from Implementing Struct in GoLand

huangapple go评论82阅读模式
英文:

Navigate to Interface from Implementing Struct in GoLand

问题

Go本身没有任何明确的方法来指定接口名称与实现的关联。
但是像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?

答案1

得分: 7

是的,GoLand可以让你跳转到一个结构体实现的接口。它也可以反过来工作,它会显示所有实现某个接口的类型。

Navigate to Interface from Implementing Struct in GoLand

英文:

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.

Navigate to Interface from Implementing Struct in GoLand

答案2

得分: 0

使用Windows中的键盘快捷键Ctrl + T或Ctrl + ALT + B显示弹出框,您可以选择是否跳转到界面或实现它。
您可以设置自己的键盘快捷键:
设置->键盘映射->导航->转到实现
点击此处查看图片描述

英文:

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

huangapple
  • 本文由 发表于 2021年9月20日 18:16:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/69252730.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定