Skip to content
/ impl Public
forked from josharian/impl

impl generates method stubs for implementing an interface.

License

Notifications You must be signed in to change notification settings

zjx20/impl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Declaration: this is a fork of https://github.com/josharian/impl, and some custom features have been added into.


impl generates method stubs for implementing an interface.

go get -u github.com/zjx20/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")
}

impl could also be used as a package, see the sample code cli/impl.go or godoc for details.

About

impl generates method stubs for implementing an interface.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%