Documentation ¶
Overview ¶
Package impl can generate method stubs to implement a given interface For usage and installation, see README file
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddedImport ¶
type AddedImport struct {
Name, Path string
}
AddedImport represents a newly added import statement to the concrete type. If name is not empty, then that import is required to have that name.
type Implementation ¶
type Implementation struct { File string // path to the Go file of the implementing type FileContent []byte // the Go file plus the method implementations at the bottom of the file Methods []byte // only the method implementations, helpful if you want to insert the methods elsewhere in the file AddedImports []*AddedImport // all the required imports for the methods, it does not filter out imports already imported by the file AllImports []*AddedImport // convenience to get a list of all the imports of the concrete type file Error error // any error encountered during the process }
Implementation defines the results of the implement method
func Implement ¶
func Implement(ifacePath, iface, implPath, impl string) (*Implementation, error)
Implement an interface and return the path to as well as the content of the file where the concrete type was defined updated with all of the missing methods
Click to show internal directories.
Click to hide internal directories.