version

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: MIT Imports: 2 Imported by: 12

README

version

Version management package

Documentation

Index

Constants

View Source
const (
	// DefaultHash is the default hash if there is no hash provided.
	DefaultHash = "dev"
	// DefaultVersion is the default version if there is no hash provided.
	DefaultVersion = "1.15.0"
)

Variables

This section is empty.

Functions

func CommitHash

func CommitHash() string

CommitHash returns a string representing the current commitHash.

func CommitHashFromGit

func CommitHashFromGit(path string) (string, error)

CommitHashFromGit returns the commit hash from the last git.

func FromGit

func FromGit(path, appName string) (string, error)

FromGit returns the version from the last git.

func FullVersion

func FullVersion() string

FullVersion returns a string representing the version and commit hash concatenated separated by a '-'.

Returns only the version if the commit hash is not defined.

func FullVersionFromGit

func FullVersionFromGit(path, appName string) (string, error)

FullVersionFromGit returns the full version from the last git.

func SetCommitHash

func SetCommitHash(hash string)

SetCommitHash sets the commit hash of the application to the value provided as hash. Empty values are accepted.

func SetCommitHashFromGit

func SetCommitHashFromGit(path string) error

SetCommitHashFromGit sets the commit hash from the last git.

func SetFromGit

func SetFromGit(path, appName string) error

SetFromGit sets the commit hash and the version from the last git.

func SetVersion

func SetVersion(ver string)

SetVersion sets the version to tha value provided as ver unless ver is empty.

func SetVersionFromGit

func SetVersionFromGit(path, appName string) error

SetVersionFromGit sets the version from the last git.

func Version

func Version() string

Version returns a string representing the current version.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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