Documentation
¶
Overview ¶
Package version provides version information for the application. It is designed to be populated at build time using ldflags.
Example usage:
go build -ldflags "-X github.com/goformx/goforms/internal/infrastructure/version.Version=1.0.0"
Index ¶
Constants ¶
View Source
const (
// UnknownVersion represents an unknown version value
UnknownVersion = "unknown"
)
Variables ¶
View Source
var ( // Version is the semantic version of the application Version = UnknownVersion // BuildTime is the time when the application was built BuildTime = UnknownVersion // GitCommit is the git commit hash of the build GitCommit = UnknownVersion // GoVersion is the version of Go used to build the application GoVersion = UnknownVersion )
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct { Version string `json:"version"` BuildTime string `json:"buildTime"` GitCommit string `json:"gitCommit"` GoVersion string `json:"goVersion"` }
Info contains version information
func (Info) Compare ¶ added in v0.1.5
Compare compares this version with another version Returns:
-1 if this version is less than the other version 0 if this version is equal to the other version 1 if this version is greater than the other version
func (Info) GetBuildTime ¶ added in v0.1.5
GetBuildTime returns the build time as a time.Time
func (Info) IsPreRelease ¶ added in v0.1.5
IsPreRelease returns true if the version is a pre-release version
Click to show internal directories.
Click to hide internal directories.