Documentation ¶
Overview ¶
Package impl writes scaffolding for the given interface using receiver as the receiver. The path is expected to be in the format of <package>.<interface>. It would be really helpful to look at the tests in impl_test.go for more use cases.
Index ¶
- func Impl(path string, receiver string, w io.Writer) error
- type CouldNotFindPackageError
- type EmptyInterfacePathError
- type Interface
- type InterfaceNotFoundError
- type InvalidImportFormatError
- type InvalidInterfacePathError
- type InvalidMethodNameError
- type Method
- type NotAnInterfaceError
- type Parameter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Impl ¶
Impl is the main entry point for the impl package. It writes scaffolding for the given interface using receiver as the receiver. The path is expected to be in the format of <package>.<interface>. For example, "io.Reader" or "impl/test_data/panther.Clawable". By default it writes scaffolding for all methods of the interface. Optionally you could specify a single method to scaffold by writing its name at the end after "::" (e.g., "impl/impl/test_data/panther.Clawable::Hardness"). It would be really helpful to look at the tests in impl_test.go for more use cases.
Types ¶
type CouldNotFindPackageError ¶
type CouldNotFindPackageError struct {
// contains filtered or unexported fields
}
func NewCouldNotFindPackageError ¶
func NewCouldNotFindPackageError(message string, args ...interface{}) *CouldNotFindPackageError
func (*CouldNotFindPackageError) Error ¶
func (e *CouldNotFindPackageError) Error() string
type EmptyInterfacePathError ¶
type EmptyInterfacePathError struct {
// contains filtered or unexported fields
}
func NewEmptyInterfacePathError ¶
func NewEmptyInterfacePathError(message string, args ...interface{}) *EmptyInterfacePathError
func (*EmptyInterfacePathError) Error ¶
func (e *EmptyInterfacePathError) Error() string
type InterfaceNotFoundError ¶
type InterfaceNotFoundError struct {
// contains filtered or unexported fields
}
func NewInterfaceNotFoundError ¶
func NewInterfaceNotFoundError(message string, args ...interface{}) *InterfaceNotFoundError
func (*InterfaceNotFoundError) Error ¶
func (e *InterfaceNotFoundError) Error() string
type InvalidImportFormatError ¶
type InvalidImportFormatError struct {
// contains filtered or unexported fields
}
func NewInvalidImportFormatError ¶
func NewInvalidImportFormatError(message string, args ...interface{}) *InvalidImportFormatError
func (*InvalidImportFormatError) Error ¶
func (e *InvalidImportFormatError) Error() string
type InvalidInterfacePathError ¶
type InvalidInterfacePathError struct {
// contains filtered or unexported fields
}
func NewInvalidInterfacePathError ¶
func NewInvalidInterfacePathError(message string, args ...interface{}) *InvalidInterfacePathError
func (*InvalidInterfacePathError) Error ¶
func (e *InvalidInterfacePathError) Error() string
type InvalidMethodNameError ¶
type InvalidMethodNameError struct {
// contains filtered or unexported fields
}
func NewInvalidMethodNameError ¶
func NewInvalidMethodNameError(message string, args ...interface{}) *InvalidMethodNameError
func (*InvalidMethodNameError) Error ¶
func (e *InvalidMethodNameError) Error() string
type NotAnInterfaceError ¶
type NotAnInterfaceError struct {
// contains filtered or unexported fields
}
func NewNotAnInterfaceError ¶
func NewNotAnInterfaceError(message string, args ...interface{}) *NotAnInterfaceError
func (*NotAnInterfaceError) Error ¶
func (e *NotAnInterfaceError) Error() string