parse

package
v4.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dir

type Dir struct {
	// contains filtered or unexported fields
}

Dir represents a parsed directory containing go files.

func Packages

func Packages(pkgPatterns ...string) []Dir

Packages looks for directories matching the passed in package patterns and returns Dir values for each directory that can be successfully imported and is found to match one of the patterns.

func (Dir) Import

func (d Dir) Import(path string) (*packages.Package, error)

Import imports path from srcDir, then loads the ast for that package. It ensures that the returned ast is for the package that would be imported by an import clause.

Import returns an error if the package requested has no go files in it.

func (Dir) Package

func (d Dir) Package() *packages.Package

Package returns the *packages.Package for d

func (Dir) Path

func (d Dir) Path() string

Path returns the file path to d.

Jump to

Keyboard shortcuts

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