move the variables set during the building process into the core package

This commit is contained in:
MaysWind
2026-02-15 01:12:48 +08:00
parent 76d1d3aef3
commit 3a66a3d655
10 changed files with 33 additions and 35 deletions
+17
View File
@@ -1,4 +1,21 @@
package core
import "fmt"
// ApplicationName represents the application name
const ApplicationName = "ezBookkeeping"
// Version, CommitHash and BuildTime are set at build
var (
Version string
CommitHash string
BuildTime string
)
func GetOutgoingUserAgent() string {
if Version == "" {
return ApplicationName
}
return fmt.Sprintf("%s/%s", ApplicationName, Version)
}