astra

package
v2.3.55 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCouldNotResolvePackage = errors.New("could not resolve package")
	ErrUnexpectedSpec         = errors.New("unexpected spec")
	ErrNotInGoPath            = errors.New("not in GOPATH")
	ErrGoPathIsEmpty          = errors.New("GOPATH is empty")
)

Functions

func GetPackage

func GetPackage(path string, options ...Option) (*types.File, error)

func IsCommonReceiver

func IsCommonReceiver(t types.Type) bool

func MergeFiles

func MergeFiles(files []*types.File) (*types.File, error)

Merges parsed files to one. Helpful, when you need full information about package.

func ParseAstFile

func ParseAstFile(file *ast.File, options ...Option) (*types.File, error)

Parses ast.File and return all top-level declarations.

func ParseFile

func ParseFile(filename string, options ...Option) (*types.File, error)

Opens and parses file by name and return information about it.

func ParsePackage

func ParsePackage(path string, options ...Option) ([]*types.File, error)

Parses all .go files from directory. Deprecated: use GetPackage instead

func ResolvePackagePath

func ResolvePackagePath(outPath string) (string, error)

Types

type Option

type Option uint
const (
	IgnoreComments Option = 1 << iota
	IgnoreStructs
	IgnoreInterfaces
	IgnoreFunctions
	IgnoreMethods
	IgnoreTypes
	IgnoreVariables
	IgnoreConstants
	AllowAnyImportAliases
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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