3 回答
TA贡献1845条经验 获得超8个赞
为了你vim的吸毒者在那里,VIM-GO使用支持先进的代码分析:GoImplements,:GoCallees,:GoChannelPeers,:GoReferrers等Oracle命令。
例如,如果我有一个如下所示的Calculator接口和实现:
type Arithmetic interface{
add(float64, float64) float64
}
type Calculator struct{}
func (c *calculator) add(o1, o2 float64) float64 {
// ... stuff
}
然后:GoImplements用我的光标在 vim 中运行type Arithmetic interface将产生如下结果:
calculator.go|8 col 6| interface type Arithmetic
calculator.go|3 col 6| is implemented by pointer type *calculator
现在,如果我将光标移动到该type Calculator struct{}行并运行:GoImplements,我将得到如下结果:
calculator.go|3 col 6| pointer type *calculator
calculator.go|8 col 6| implements Arithmetic
注意:如果您收到“未知命令”错误,请:GoInstallBinaries在重试之前先尝试执行。
- 3 回答
- 0 关注
- 190 浏览
添加回答
举报