-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion.go
More file actions
31 lines (26 loc) · 722 Bytes
/
version.go
File metadata and controls
31 lines (26 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
// Version information set by ldflags during build.
// Example: go build -ldflags "-X main.Version=1.0.0 -X main.Commit=abc123"
var (
// Version is the semantic version (e.g., "0.1.0")
Version = "dev"
// Commit is the git commit hash
Commit = "none"
// BuildDate is the build timestamp
BuildDate = "unknown"
)
// VersionInfo returns formatted version information.
func VersionInfo() string {
return Version
}
// FullVersionInfo returns detailed version information.
func FullVersionInfo() string {
info := "revoco " + Version
if Commit != "none" && Commit != "" {
info += " (" + Commit + ")"
}
if BuildDate != "unknown" && BuildDate != "" {
info += " built " + BuildDate
}
return info
}