Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version = "dev" // Version number GitCommit = "unknown" // Git commit hash BuildDate = "unknown" // Build date GoVersion = runtime.Version() )
These variables are set at build time using ldflags
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct {
Version string `json:"version"`
GitCommit string `json:"git_commit"`
BuildDate string `json:"build_date"`
GoVersion string `json:"go_version"`
Arch string `json:"arch"`
OS string `json:"os"`
}
Info contains version information
func (Info) Detailed ¶
Detailed returns detailed version information
Example ¶
info := Info{
Version: "1.0.0",
GitCommit: "abc123",
BuildDate: "2024-01-15",
GoVersion: "go1.21.0",
OS: "darwin",
Arch: "arm64",
}
fmt.Println(info.Detailed())
Output: devx version information: Version: 1.0.0 Git commit: abc123 Build date: 2024-01-15 Go version: go1.21.0 OS/Arch: darwin/arm64
Click to show internal directories.
Click to hide internal directories.