Documentation ¶
Overview ¶
Package packages provides utility functions related to package manipulation
Package packages provides utility functions related to package manipulation
Index ¶
- func GetCodeFiles(pkg *build.Package) []string
- func GetImportedPackages(pkg *build.Package) []string
- func IsExternalPackage(pkg, mainPackage string) bool
- func IsInternalPackage(pkg, mainPackage string) bool
- func IsOrganizationPackage(pkg string, orgPatterns []string) bool
- func IsStandardPackage(pkg string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCodeFiles ¶
GetCodeFiles returns the list of code files in a certain package. The code files are: GoFiles, CgoFiles and TestGoFiles
func GetImportedPackages ¶ added in v1.2.2
GetImportedPackages returns the list of imported packages, considering imports from source and test files. The result contains Imports and TestImports
func IsExternalPackage ¶
IsExternalPackage verify if a certain package is not part of: the module package, standard lib or sub-repositories
func IsInternalPackage ¶
IsInternalPackage verify if a certain package is a part of the golang module represented by `mainPackage`
func IsOrganizationPackage ¶
IsOrganizationPackage checks if a package is maintained for this organization. orgPatterns is a list of packages prefixes, so then this function checks if the provided package starts with any of this package patterns.
func IsStandardPackage ¶
IsStandardPackage verify if a certain package is a part of golang standard lib or not. this function returns true for standard lib packages (https://pkg.go.dev/std) and for Sub-repositories (https://pkg.go.dev/golang.org/x)
Types ¶
This section is empty.