๐Ÿ“ฆ josharian / impl

impl generates method stubs for implementing an interface.

โ˜… 1.1k stars โ‘‚ 92 forks ๐Ÿ‘ 1.1k watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/josharian/impl.git
HTTPS git clone https://github.com/josharian/impl.git
SSH git clone git@github.com:josharian/impl.git
CLI gh repo clone josharian/impl
Josh Bleecher Snyder Josh Bleecher Snyder make isPathRune better match the spec 923c93e 1 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ testdata
๐Ÿ“„ .gitignore
๐Ÿ“„ go.mod
๐Ÿ“„ go.sum
๐Ÿ“„ impl_test.go
๐Ÿ“„ impl.go
๐Ÿ“„ implemented.go
๐Ÿ“„ LICENSE.txt
๐Ÿ“„ README.md
๐Ÿ“„ README.md

impl generates method stubs for implementing an interface.

go install github.com/josharian/impl@latest

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 or vim-go-impl