modulepath

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractVersionFromTag

func ExtractVersionFromTag(tag, subpath string) (string, error)

ExtractVersionFromTag extracts the version part from a tag that includes a subpath. Returns the version string (e.g., "v1.0.0") and the original tag if no subpath.

func FilterTagsForSubpath

func FilterTagsForSubpath(tags []string, subpath string) []string

FilterTagsForSubpath filters tags that match the subpath. Supports two formats: 1. Prefix format: subpath/v1.0.0 2. Suffix format: v1.0.0-subpath

Types

type ModulePath

type ModulePath struct {
	RepoURL string // The repository URL (e.g., github.com/user/repo)
	Subpath string // The subpath within the repo (e.g., intrusive_list)
	Full    string // The full module path
}

ModulePath represents a parsed module path with repo URL and optional subpath

func ParseModulePath

func ParseModulePath(path string) (ModulePath, error)

ParseModulePath parses a module path into repo URL and subpath. Examples:

  • github.com/user/repo -> repo: github.com/user/repo, subpath: ""
  • github.com/user/repo/subpath -> repo: github.com/user/repo, subpath: subpath
  • github.com/user/repo/path/to/module -> repo: github.com/user/repo, subpath: path/to/module

Jump to

Keyboard shortcuts

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