tags

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2018 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	ErrNoTagsFound = errors.New("No tags found")
)

Functions

This section is empty.

Types

type Tag

type Tag struct {
	Name string
	When time.Time
}

func GetLatestTag

func GetLatestTag(repoURL string, includeLightweight bool) (*Tag, error)

GetLatestTag clones a Git repository into memory and resolves latest leightweight or annotated tag from it

Example
tag, err := GetLatestTag("https://github.com/luzifer-ansible/deploy-git.git", true)
if err != nil {
	log.Fatalf("Could not resolve latest tag: %s", err)
}

log.Printf("Latest tag: %q, created at %v", tag.Name, tag.When)
Output:

Jump to

Keyboard shortcuts

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