Documentation
¶
Overview ¶
Package version provides utilities and methods for getting the base version of a repository and calculating the patch level.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrLastCommitNotFound = errors.New("version: last commit not found")
ErrLastCommitNotFound is an error emitted if the last commit cannot be found.
Functions ¶
func CountCommits ¶
CountCommits returns the number of commits in the repo since the specified hash.
Types ¶
type File ¶
File implements Versioner using a file in the repository.
func (*File) LastCommit ¶
LastCommit returns the commit hash containing the last change to FileName.
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
Tag implements Versioner using a tag in the repository.
func (*Tag) LastCommit ¶
LastCommit returns the commit hash containing of the most recent version tag. A tag is considered to contain a version if the tag name is parsable as a semantic version (https://semver.org/) with an optional leading 'v' (e.g. v1.2.3 or 5.3.0).