packages

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package packages provides utility functions related to package manipulation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCodeFiles

func GetCodeFiles(pkg *build.Package) []string

GetCodeFiles returns the list of code files in a certain package. The code files are: GoFiles, CgoFiles and TestGoFiles

func IsExternalPackage

func IsExternalPackage(pkg, mainPackage string) bool

IsExternalPackage verify if a certain package is not part of: the module package, standard lib or sub-repositories

func IsInternalPackage

func IsInternalPackage(pkg, mainPackage string) bool

IsInternalPackage verify if a certain package is a part of the golang module represented by `mainPackage`

func IsOrganizationPackage

func IsOrganizationPackage(pkg string, orgPatterns []string) bool

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

func IsStandardPackage(pkg string) bool

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.

Jump to

Keyboard shortcuts

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