add version information
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 5s
Gitea Actions Demo / build-and-test (push) Failing after 12m31s

This commit is contained in:
2026-10-24 02:08:56 +02:00
parent b3530cec7b
commit 8ef3e201d6
9 changed files with 120 additions and 12 deletions
+30
View File
@@ -0,0 +1,30 @@
package cmd
import (
"fmt"
"log/slog"
"github.com/spf13/cobra"
)
var (
version = "unset"
commit = "unset"
date = "unset"
)
var versionCmd = &cobra.Command{
Use: "version",
Short: "Show Kontor Version",
Long: "Show Kontor Version",
Run: func(cmd *cobra.Command, args []string) {
slog.Info("version kontor")
fmt.Println("Version: ", version)
fmt.Println("Version: ", commit)
fmt.Println("Version: ", date)
},
}
func init() {
rootCmd.AddCommand(versionCmd)
}
+7 -3
View File
@@ -1,7 +1,11 @@
package globals
var Secret = []byte("secret")
var (
Secret = []byte("secret")
Version = "0.4.0"
Commit = "unset"
Date = "unset"
)
const UserKey = "user"
const Version = "0.4.0"