Documentation ¶
Index ¶
- func ForEachConstSpec(genDecl *ast.GenDecl, ...)
- func ForEachImportSpec(genDecl *ast.GenDecl, ...)
- func ForEachTypeSpec(genDecl *ast.GenDecl, ...)
- func ForEachVarSpec(genDecl *ast.GenDecl, ...)
- func MockCocoList() []gococo.Coco
- func ParseTypeDef(pth string) (map[string]*ParseResult, error)
- type GenDeclParseResult
- type InspectHandler
- type ParseResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForEachConstSpec ¶
func ForEachConstSpec(genDecl *ast.GenDecl, fn func(spec *ast.ValueSpec, declComment *ast.CommentGroup))
ForEachConstSpec performs the operation fn on all sepc of a genDecl of type `token.CONST`. If the type of genDecl is not `token.CONST`, nothing will happen. For each fn execution, the Comment of genDecl will also be passed in. @see https://golang.org/pkg/go/ast/#GenDecl
func ForEachImportSpec ¶
func ForEachImportSpec(genDecl *ast.GenDecl, fn func(spec *ast.ImportSpec, declComment *ast.CommentGroup))
ForEachImportSpec performs the operation fn on all sepc of a genDecl of type `token.IMPORT`. If the type of genDecl is not `token.IMPORT`, nothing will happen. For each fn execution, the Comment of genDecl will also be passed in. @see https://golang.org/pkg/go/ast/#GenDecl
func ForEachTypeSpec ¶
func ForEachTypeSpec(genDecl *ast.GenDecl, fn func(spec *ast.TypeSpec, declComment *ast.CommentGroup))
ForEachTypeSpec performs the operation fn on all sepc of a genDecl of type `token.TYPE`. If the type of genDecl is not `token.TYPE`, nothing will happen. For each fn execution, the Comment of genDecl will also be passed in. @see https://golang.org/pkg/go/ast/#GenDecl
func ForEachVarSpec ¶
func ForEachVarSpec(genDecl *ast.GenDecl, fn func(spec *ast.ValueSpec, declComment *ast.CommentGroup))
ForEachVarSpec performs the operation fn on all sepc of a genDecl of type `token.VAR`. If the type of genDecl is not `token.VAR`, nothing will happen. For each fn execution, the Comment of genDecl will also be passed in. @see https://golang.org/pkg/go/ast/#GenDecl
func MockCocoList ¶
func ParseTypeDef ¶
func ParseTypeDef(pth string) (map[string]*ParseResult, error)
Types ¶
type GenDeclParseResult ¶
func (GenDeclParseResult) String ¶
func (result GenDeclParseResult) String() string
type InspectHandler ¶
InspectHandler
type ParseResult ¶
type ParseResult struct { PackageName string Import map[string]GenDeclParseResult Type map[string]GenDeclParseResult Const map[string]GenDeclParseResult Value map[string]GenDeclParseResult }
func NewResult ¶
func NewResult() *ParseResult
func (*ParseResult) String ¶
func (result *ParseResult) String() string