Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrMethodExists ¶
ErrMethodExists will be returned when a method should be created but an existing method already exists for the given receiver.
func (*ErrMethodExists) Error ¶
func (e *ErrMethodExists) Error() string
type Implementer ¶
type Implementer struct {
Recv, IFace, Dir string
// contains filtered or unexported fields
}
An Implementer can, for a certain directory, create and/or update implementation with Go source code for a particular interface
func (*Implementer) GenForPosition ¶
func (i *Implementer) GenForPosition(p *token.Position) ([]byte, error)
GenForPosition allows users to have more flexible stub generation, with the ability to specify exactly where the implementation should be generated. If the token.Position argument is nil, the generated code will be inserted immediately after the receiving type's declaration.
func (*Implementer) GenStubs ¶
func (i *Implementer) GenStubs() ([]byte, error)
GenStubs prints nicely formatted method stubs for fns using receiver expression recv. If the Implementer is not in a valid state, or an error occurs, the error will be returned.