:GoImpl command for Go
When you have an interface
typeFoointerface {
DoSomething()
}Implement struct of struct/interface under the cursor
:GoImpl
typeFooImplstruct {
}
type (f*FooImpl) DoSomething() {
panic("notimplemented") // TODO: Implement
}Implement struct of struct/interface with given interface
:GoImpl io.Reader
func (r*Reader) Read(p []byte) (nint, errerror) {
panic("not implemented") // TODO: Implement
}Implement struct of struct/interface with given interface and given name
:GoImpl io.Reader Bar
typeBarstruct {
}
func (b*Bar) Read(p []byte) (nint, errerror) {
panic("not implemented") // TODO: Implement
}For vim-plug plugin manager:
Plug 'mattn/vim-goimpl'MIT
Yasuhiro Matsumoto (a.k.a. mattn)