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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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