packages

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(conf *Config, pattern ...string) (pkgPaths []string, err error)

func Load

func Load(conf *Config, pattern ...string) (pkgs []*types.Package, err error)

Types

type Config

type Config struct {
	// ModRoot specifies module root directory (required).
	ModRoot string

	// ModPath specifies module path (required).
	ModPath string

	// SupportedExts specifies all supported file extensions (optional).
	SupportedExts map[string]struct{}

	// Loaded specifies all loaded packages (optional).
	Loaded map[string]*types.Package

	// Fset provides source position information for syntax trees and types (optional).
	// If Fset is nil, Load will use a new fileset, but preserve Fset's value.
	Fset *token.FileSet
}

type ExecCmdError

type ExecCmdError struct {
	Err    error
	Stderr []byte
}

func (*ExecCmdError) Error

func (p *ExecCmdError) Error() string

type Importer

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

func NewImporter

func NewImporter(conf *Config, pattern ...string) (p *Importer, pkgPaths []string, err error)

func (*Importer) Import

func (p *Importer) Import(pkgPath string) (*types.Package, error)

type PkgToLoad

type PkgToLoad struct {
	ImportPath     string
	Root           string
	Export         string
	GoFiles        []string
	IgnoredGoFiles []string
	Imports        []string
	Deps           []string
}

func LoadPkgs

func LoadPkgs(dir string, pattern ...string) (pkgs []*PkgToLoad, err error)

Jump to

Keyboard shortcuts

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