From 0150429e8219ecbe8fcc158d798984af94492e07 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Thu, 7 Aug 2025 18:48:35 +0200 Subject: [PATCH] Add commit hash and build time to version output --- cmd/server/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/server/main.go b/cmd/server/main.go index 5cc740d..4d56eb5 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -13,6 +13,8 @@ import ( // version is set at build time using -ldflags "-X main.version=1.0.0" var version string = "unknown" +var commitHash string = "unknown" +var buildTime string = "unknown" // @title llamactl API // @version 1.0 @@ -25,6 +27,8 @@ func main() { // --version flag to print the version if len(os.Args) > 1 && os.Args[1] == "--version" { fmt.Printf("llamactl version: %s\n", version) + fmt.Printf("Commit hash: %s\n", commitHash) + fmt.Printf("Build time: %s\n", buildTime) return }