impl generates method stubs for implementing an interface.
Go
Switch branches/tags
Nothing to show
Clone or download
Carpetsmoker and josharian Add special case for the built-in error interface
`error` is Go's only predeclared type, and can't be resolved using the
regular ast traversal. So attempting to use `impl` to add the `error`
interface would error out.

https://golang.org/ref/spec#Errors
Latest commit 3d0f908 Feb 27, 2018

README.md

impl generates method stubs for implementing an interface.

go get -u github.com/josharian/impl

Sample usage:

$ impl 'f *File' io.ReadWriteCloser
func (f *File) Read(p []byte) (n int, err error) {
	panic("not implemented")
}

func (f *File) Write(p []byte) (n int, err error) {
	panic("not implemented")
}

func (f *File) Close() error {
	panic("not implemented")
}

# You can also provide a full name by specifying the package path.
# This helps in cases where the interface can't be guessed
# just from the package name and interface name.
$ impl 's *Source' golang.org/x/oauth2.TokenSource
func (s *Source) Token() (*oauth2.Token, error) {
    panic("not implemented")
}

You can use impl from Vim with vim-go-impl