feat(deploy): 在线更新 - 新增后台检查、强制备份迁移与失败自动回退

This commit is contained in:
ddCat committed 2026-08-30 22:15:17 +08:00
1 parent 8227921c68
commit 694cb974fb
60 files changed
+4124 -93

No files matched your search

@@ -0,0 +1,17 @@
package buildinfo
import "testing"
func TestCurrentUsesInjectedValues(t *testing.T) {
previousVersion, previousCommit, previousBuildTime := Version, Commit, BuildTime
t.Cleanup(func() { Version, Commit, BuildTime = previousVersion, previousCommit, previousBuildTime })
Version, Commit, BuildTime = " v1.2.3 ", " abc123 ", " 2026-08-30T00:00:00Z "
info := Current()
if info.Version != "v1.2.3" || info.Commit != "abc123" || info.BuildTime != "2026-08-30T00:00:00Z" {
t.Fatalf("unexpected build info: %#v", info)
}
if info.GoVersion == "" {
t.Fatal("Go version should be populated")
}
}