load

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	AbsPath string
	Name    string
	Content []byte
	Error   error
	Syntax  *ast.File
}

type LoadOptions

type LoadOptions struct {
	Dir         string
	Overlay     overlay.Overlay
	Mod         string
	IncludeTest bool
	ModFile     string // -modfile flag
	Deps        bool   // -deps flag

	// OverlayFile is passed to `go list -overlay=` during package discovery.
	// Overlay (in-memory) is used only when reading/parsing file contents.
	// Callers that rely on go.mod replacements visible only through an overlay
	// (e.g. doctest vendor-gomod bridges) must set OverlayFile or discovery
	// returns Incomplete packages with empty GoFiles.
	OverlayFile string

	// max file size to parse
	// if file size is larger than this
	// see https://github.com/xhd2015/xgo/issues/303
	// for more background
	MaxFileSize int64

	Goroot string

	FilterErrorFile bool

	Fset *token.FileSet
}

type Package

type Package struct {
	GoPackage *goinfo.Package
	Files     []*File
}

type Packages

type Packages struct {
	Fset     *token.FileSet
	Packages []*Package
}

func LoadPackages

func LoadPackages(args []string, opts LoadOptions) (*Packages, error)

func (*Packages) Filter

func (c *Packages) Filter(f func(pkg *Package) bool) *Packages

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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