astutil

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirToAstWalker

func DirToAstWalker(targetDir string) (map[string]AstPkgWalker, error)

DirToAstWalker initializes map of AstPkgWalker from given directory

Types

type AstPkgWalker

type AstPkgWalker struct {
	FileSet *token.FileSet
	Pkg     *ast.Package
	Files   []*ast.File
	Decls   []ast.Decl

	PkgPath string
}

AstPkgWalker represents ast package walker

func ParseAstPkg

func ParseAstPkg(fset *token.FileSet, pkg *ast.Package) (AstPkgWalker, error)

ParseAstPkg parses package ast

func (AstPkgWalker) AllGenDecls

func (w AstPkgWalker) AllGenDecls() []*ast.GenDecl

AllGenDecls returns all generic declaration nodes

func (AstPkgWalker) AllStructSpecs

func (w AstPkgWalker) AllStructSpecs() []*ast.TypeSpec

AllStructSpecs returns all struct type specs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL