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
+1 -18
View File
@@ -1,11 +1,5 @@
package settings
import (
"fmt"
"github.com/mayswind/ezbookkeeping/pkg/core"
)
// ConfigContainer contains the current setting config
type ConfigContainer struct {
current *Config
@@ -13,10 +7,7 @@ type ConfigContainer struct {
// Initialize a config container singleton instance
var (
Version string
CommitHash string
BuildTime string
Container = &ConfigContainer{}
Container = &ConfigContainer{}
)
// SetCurrentConfig sets the current config by a given config
@@ -28,11 +19,3 @@ func SetCurrentConfig(config *Config) {
func (c *ConfigContainer) GetCurrentConfig() *Config {
return c.current
}
func GetUserAgent() string {
if Version == "" {
return core.ApplicationName
}
return fmt.Sprintf("%s/%s", core.ApplicationName, Version)
}