mod

package
v1.3.4-beta5 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: AGPL-3.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// By convention, modules with a major version equal to or above v2
	// have it as suffix in their module path.
	VCSUrlMajorVersionSuffixRegex = regexp.MustCompile(`(/v[\d]+)$`)

	// gopkg.in/user/pkg.v -> github.com/user/pkg
	VCSUrlGoPkgInRegexWithUser = regexp.MustCompile(`^gopkg\.in/([^/]+)/([^.]+)\..*$`)

	// gopkg.in without user segment
	// Example: gopkg.in/pkg.v3 -> github.com/go-pkg/pkg
	VCSUrlGoPkgInRegexWithoutUser = regexp.MustCompile(`^gopkg\.in/([^.]+)\..*$`)
)

Functions

func ModuleID

func ModuleID(name, version string) string

ModuleID returns a module ID according the Go way. Format: <module_name>@v<module_version> e.g. github.com/aquasecurity/go-dep-parser@v0.0.0-20230130190635-5e31092b0621

func NewParser

func NewParser(replace bool) types.Parser

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func (*Parser) GetExternalRefs

func (p *Parser) GetExternalRefs(path string) []types.ExternalRef

func (*Parser) Parse

Parse parses a go.mod file

Jump to

Keyboard shortcuts

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