Documentation
¶
Index ¶
Constants ¶
View Source
const ( ParamPrefix = "arg" ResultPrefix = "result" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Function ¶
Function wraps ast.Field to provide some useful methods.
func (*Function) Imports ¶
func (f *Function) Imports(pkgImports []*ast.ImportSpec) ImportGroup
Imports returns all imports of function.
func (*Function) Params ¶
func (f *Function) Params() ValueGroup
Params returns all params of function.
func (*Function) Results ¶
func (f *Function) Results() ValueGroup
Results returns all results of function.
type Import ¶
type Import struct{ *ast.ImportSpec }
type ImportGroup ¶
type ImportGroup []*Import
ImportGroup is a group of imports.
func (ImportGroup) String ¶
func (ig ImportGroup) String() string
String returns the string representation of ImportGroup.
func (ImportGroup) Uniq ¶
func (ig ImportGroup) Uniq() ImportGroup
Uniq returns a new ImportGroup with unique imports.
type Interface ¶
type Interface struct{ *ast.InterfaceType }
func (*Interface) Imports ¶
func (i *Interface) Imports(pkgImports []*ast.ImportSpec) ImportGroup
Imports returns all imports of interface.
type Value ¶
Value is a value of interface, which wraps ast.Field.
func (*Value) DirectTypename ¶ added in v1.5.1
func (*Value) ImportPackageName ¶
ImportPackageName returns the package name of the import.
func (*Value) IsBuiltInType ¶
func (*Value) IsPointerType ¶ added in v1.5.1
type ValueGroup ¶
type ValueGroup []*Value
ValueGroup is a group of Value. It is used to represent the return values of a method.
func (ValueGroup) Imports ¶
func (vs ValueGroup) Imports(pkgImports []*ast.ImportSpec) ImportGroup
func (ValueGroup) String ¶
func (vs ValueGroup) String(prefix string) string
Click to show internal directories.
Click to hide internal directories.