Documentation
¶
Overview ¶
Package version provides functionality for managing and retrieving version information of the application. Data is populated during the build process or as outlined during dev
Default Version: v0.0.0-dev.unknown is returned in the event Version is invalid
Default CommitHash, BuildDate, GoVersion: unknown is the default value applied in the absence of a built binary
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" // e.g. "v0.1.0" or "v0.0.0-dev.abc1234" CommitHash = "unknown" // e.g. "abc1234" BuildDate = "unknown" // e.g. "2025-07-15T10:30:00Z" GoVersion = "unknown" // e.g. "go1.24.1" )
Build information - set by ldflags during compilation
Functions ¶
func IsValidSemVer ¶
IsValidSemVer checks if the given version string follows semantic versioning format
Types ¶
type BuildInfo ¶
type BuildInfo struct {
Version string `json:"version"`
CommitHash string `json:"commit_hash"`
BuildDate string `json:"build_date"`
GoVersion string `json:"go_version"`
Platform string `json:"platform"`
ModuleInfo string `json:"module_info,omitempty"`
}
BuildInfo contains version and build information
func (*BuildInfo) GetShortCommit ¶
GetShortCommit returns the first 7 characters of the commit hash
func (*BuildInfo) IsDevelopment ¶
IsDevelopment returns true if this is a development build