tag

package
v0.0.102 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoTag = fmt.Errorf("no tag found")

Functions

func AddVersionPrefix added in v0.0.93

func AddVersionPrefix(prefix string) string

func GetLatestVersionTag added in v0.0.87

func GetLatestVersionTag(dir string, versionPrefix string) (string, error)

GetLatestVersionTag returns the latest version tag in the directory that has versionPrefix as prefix The basic name (part after stripping versionPrefix) should not contain "/" If versionPrefix is "", then the returned tag should not be nested (no "/" in it)

func GetSubPath added in v0.0.93

func GetSubPath(dir string) (string, []string, error)

func GetVersionPrefix added in v0.0.93

func GetVersionPrefix(dir string) (string, error)

func GetVersionTag added in v0.0.93

func GetVersionTag(targetDir, commit, tagPrefix string) (string, error)

GetVersionTagAtHEAD checks if there's a version tag at HEAD in the target directory tagPrefix is an optional prefix for the tag (e.g., "path/to/submodule/" for nested modules) If tagPrefix is empty, it will match tags like "v0.0.87" If tagPrefix is provided, it will match tags like "path/to/submodule/v0.0.87"

func GetVersionTagAtHEAD

func GetVersionTagAtHEAD(targetDir, tagPrefix string) (string, error)

func ListTags added in v0.0.93

func ListTags(targetDir string, commit string) ([]string, error)

ListTagsAtHEAD returns all tags pointing at HEAD in the target directory

func ListTagsAtHEAD

func ListTagsAtHEAD(targetDir string) ([]string, error)

func StripVersionPrefix added in v0.0.93

func StripVersionPrefix(prefix string, tag string) string

StripVersionPrefix strips the version prefix from a tag to get the clean version Examples:

  • StripVersionPrefix("", "v1.2.3") -> "v1.2.3"
  • StripVersionPrefix("submodule/", "submodule/v1.2.3") -> "v1.2.3"
  • StripVersionPrefix("path/to/module/", "path/to/module/v2.0.0") -> "v2.0.0"

Types

This section is empty.

Jump to

Keyboard shortcuts

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