From 1e2cac885d820d2a399d48c6921c46d9826deb20 Mon Sep 17 00:00:00 2001 From: SunBK201 Date: Thu, 27 Nov 2025 13:21:12 +0800 Subject: [PATCH] feat: update app version handling in Makefile and main.go --- openwrt/Makefile | 2 +- src/main.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openwrt/Makefile b/openwrt/Makefile index 39ac949..d8408f1 100644 --- a/openwrt/Makefile +++ b/openwrt/Makefile @@ -17,7 +17,7 @@ PKG_BUILD_PARALLEL:=1 PKG_BUILD_FLAGS:=no-mips16 GO_PKG:=github.com/sunbk201/ua3f -GO_PKG_LDFLAGS_X:= main.version=$(PKG_VERSION) +GO_PKG_LDFLAGS_X:=main.appVersion=v$(PKG_VERSION) include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk diff --git a/src/main.go b/src/main.go index aecc671..d848355 100644 --- a/src/main.go +++ b/src/main.go @@ -16,7 +16,7 @@ import ( "github.com/sunbk201/ua3f/internal/statistics" ) -const version = "1.8.8" +var appVersion = "Development" func main() { cfg, showVer := config.Parse() @@ -24,11 +24,11 @@ func main() { log.SetLogConf(cfg.LogLevel) if showVer { - fmt.Printf("UA3F version %s\n", version) + fmt.Printf("UA3F version %s\n", appVersion) return } - log.LogHeader(version, cfg) + log.LogHeader(appVersion, cfg) rw, err := rewrite.New(cfg) if err != nil {