Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/josharian/impl
impl generates method stubs for implementing an interface.
https://github.com/josharian/impl
Last synced: 4 days ago
JSON representation
impl generates method stubs for implementing an interface.
- Host: GitHub
- URL: https://github.com/josharian/impl
- Owner: josharian
- License: mit
- Created: 2014-07-19T00:37:33.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2024-06-24T23:29:12.000Z (7 months ago)
- Last Synced: 2024-12-31T08:09:53.625Z (11 days ago)
- Language: Go
- Size: 68.4 KB
- Stars: 1,039
- Watchers: 10
- Forks: 90
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome - impl - impl generates method stubs for implementing an interface. (Go)
README
`impl` generates method stubs for implementing an interface.
```bash
go install github.com/josharian/impl@latest
```Sample usage:
```bash
$ 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](https://github.com/fatih/vim-go) or
[vim-go-impl](https://github.com/rhysd/vim-go-impl)