pkgs

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTestPackage

func IsTestPackage(pkg *Package) bool

IsTestPackage returns true if the given package is a test package and false otherwise.

func RelativePackageName

func RelativePackageName(pkg *Package, rootPkg string) (relPkg, strictRelPkg string)

RelativePackageName return the package name relative towards the given root package. relPkg can be `/`, `main` or a path like `pkg/x/mytool`. strictRelPkg can be `/`, a path like `pkg/x/mytool` or empty.

func UniquePackageName

func UniquePackageName(relPkg, strictRelPkg string) string

UniquePackageName returns strictRelPkg if it isn't empty and relPkg otherwise.

func UniquePackages

func UniquePackages(pkgs []*Package) map[string]*PackageInfo

UniquePackages makes the given list of packages unique.

Types

type Package

type Package = packages.Package

Package is a type alias so other packages can save the import

type PackageInfo

type PackageInfo struct {
	UniqName string
	Size     int
	Type     PkgType
	Deps     []*PackageInfo
	Pkg      *Package
}

type PkgType

type PkgType int

PkgType is an enum with values like 'Tool' and 'HalfDB'

const (
	PkgTypeStandard PkgType = iota
	PkgTypeHalfTool
	PkgTypeTool
	PkgTypeHalfDB
	PkgTypeDB
	PkgTypeGod
)

Jump to

Keyboard shortcuts

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