英文:
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可以让你跳转到一个结构体实现的接口。它也可以反过来工作,它会显示所有实现某个接口的类型。
英文:
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.
答案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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论