imports

package
v0.0.0-...-d850389 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: BSD-3-Clause Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindImportPaths

func FindImportPaths(ctx context.Context, startPkg, findPkg string) ([][]string, error)

FindImportPaths returns a slice of slices indicating the import paths from one package to another.

func FindImporters

func FindImporters(ctx context.Context, findPkg string) ([]string, error)

FindImporters returns a slice of package names indicating which packages under go.skia.org/infra/... directly import the given package.

func IsBuiltIn

func IsBuiltIn(pkgName string) bool

IsBuiltIn returns true if the given package name looks like a built-in package.

func LoadAllPackageData

func LoadAllPackageData(ctx context.Context) (map[string]*Package, error)

LoadAllPackageData obtains information about all packages under go.skia.org/infra/... and caches it, returning it for convenience.

Types

type Package

type Package struct {
	Dir           string   `json:",omitempty"` // directory containing package sources
	ImportPath    string   `json:",omitempty"` // import path of package in dir
	ImportComment string   `json:",omitempty"` // path in import comment on package statement
	Name          string   `json:",omitempty"` // package name
	Doc           string   `json:",omitempty"` // package documentation string
	Target        string   `json:",omitempty"` // installed target for this package (may be executable)
	ForTest       string   `json:",omitempty"` // package is only for use in named test
	Export        string   `json:",omitempty"` // file containing export data (set by go list -export)
	Match         []string `json:",omitempty"` // command-line patterns matching this package
	Standard      bool     `json:",omitempty"` // is this package part of the standard Go library?

	// Dependency information
	Imports []string `json:",omitempty"` // import paths used by this package
	Deps    []string `json:",omitempty"` // all (recursively) imported dependencies
}

Package contains information about a Go package. Ideally we would just reuse cmd/go/internal/load.Package, but we're not allowed to import internal packages. So we've copy/pasted the relevant parts of that struct below.

func GetPackageData

func GetPackageData(ctx context.Context, name string) (*Package, error)

GetPackageData returns information about the given package.

Jump to

Keyboard shortcuts

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