golang

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterPackagesWithTests

func FilterPackagesWithTests(pkgs []string) []string

Filter out test packages with no actual test functions

func FindAffectedPackages

func FindAffectedPackages(pkg string, depMap DepMap, externalPackage bool, maxDepth int) []string

func GetFilePackages

func GetFilePackages(files []string) ([]string, error)

func GetGoFileMap

func GetGoFileMap(packages []Package, includeTestFiles bool) map[string][]string

GetGoFileMap returns a map of go files to the packages that embed them

func GetPackageNames

func GetPackageNames(dirs []string) []string

func GoList

func GoList() (*utils.CmdOutput, error)

Types

type DepMap

type DepMap map[string][]string

func GetGoDepMap

func GetGoDepMap(packages []Package) DepMap

type Package

type Package struct {
	Dir          string   `json:"Dir"`
	ImportPath   string   `json:"ImportPath"`
	Root         string   `json:"Root"`
	Deps         []string `json:"Deps"`
	TestImports  []string `json:"TestImports"`
	XTestImports []string `json:"XTestImports"`
	GoFiles      []string `json:"GoFiles"`
	TestGoFiles  []string `json:"TestGoFiles"`
	XTestGoFiles []string `json:"XTestGoFiles"`
	EmbedFiles   []string `json:"EmbedFiles"`
}

func ParsePackages

func ParsePackages(goList bytes.Buffer) ([]Package, error)

ParsePackages parses the output of `go list -json ./...` and returns a slice of Package structs

Jump to

Keyboard shortcuts

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