load

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BuildMod string // BuildMod can be set readonly, vendor, or mod.
)

Functions

func Embed added in v0.8.8

func Embed(bp *build.Package, fset *token.FileSet, files []*ast.File, test bool, xtest bool) (*ast.File, error)

Embed check package embed data

func EmbedFiles added in v0.9.1

func EmbedFiles(pkgName string, dir string, fset *token.FileSet, files []*ast.File) (*ast.File, error)

func GetImportPath

func GetImportPath(pkgName string, dir string) (string, error)

GetImportPath get import path from dir. - lookup go.mod and check modpath+dir+pkgname - use go list check if BuildMod == "mod".

func ParseModFile

func ParseModFile(file string) (*modfile.File, error)

ParseModFile parse go.mod

func TestMain

func TestMain(bp *build.Package) ([]byte, error)

TestMain create testmain data form package

Types

type CoverVar

type CoverVar struct {
	File string // local file name
	Var  string // name of count struct
}

CoverVar holds the name of the generated coverage variables targeting the named file.

type LinkSym added in v0.10.0

type LinkSym struct {
	Kind     ast.ObjKind
	PkgPath  string
	Name     string
	Linkname Linkname
}

func ParseLinkname added in v0.10.0

func ParseLinkname(fset *token.FileSet, pkgPath string, files []*ast.File) ([]*LinkSym, error)

ParseLinkname parse ast files go:linkname //go:linkname <localname> <importpath>.<name> //go:linkname <localname> <importpath>.<type>.<name> //go:linkname <localname> <importpath>.<(*type)>.<name> //go:linkname <localname> linkname indicate by runtime package

func (*LinkSym) String added in v0.10.0

func (l *LinkSym) String() string

type Linkname added in v0.10.0

type Linkname struct {
	PkgPath string
	Name    string
	Recv    string
	Method  string
}

type ListDriver

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

ListDriver implement (*igop.Context).Lookup use go list

func (*ListDriver) Lookup

func (d *ListDriver) Lookup(root string, path string) (dir string, found bool)

Lookup implement (*igop.Context).Lookup

func (*ListDriver) Parse

func (d *ListDriver) Parse(root string) error

Parse parse deps by go list

type TestCover

type TestCover struct {
	Mode     string
	Local    bool
	Pkgs     []*build.Package
	Paths    []string
	Vars     []coverInfo
	DeclVars func(*build.Package, ...string) map[string]*CoverVar
}

TestCover not used

Jump to

Keyboard shortcuts

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