From eb414749c332ee0494fbe04b939f7986dc16557f Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Sat, 28 Mar 2026 20:42:57 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20apiversion.UseLatest=20=E9=98=88?= =?UTF-8?q?=E5=80=BC=E5=88=A4=E6=96=AD=E6=94=B9=E4=B8=BA=20>=3D=20?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E8=AF=AF=E5=88=A4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=B8=BA=E8=80=81=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原 compare > 0 要求严格大于阈值,导致 header=1.0.0 被判为老版本, 去掉最后一个套餐后列表为空。改为 >= 0,有 header 且版本 >= 阈值均视为新版本。 Co-Authored-By: claude-flow --- pkg/apiversion/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apiversion/version.go b/pkg/apiversion/version.go index 1e0cbd6..c5c6ff5 100644 --- a/pkg/apiversion/version.go +++ b/pkg/apiversion/version.go @@ -54,7 +54,7 @@ func UseLatest(header string, threshold string) bool { thresholdVersion, _ = Parse(DefaultThreshold) } - return compare(currentVersion, thresholdVersion) > 0 + return compare(currentVersion, thresholdVersion) >= 0 } func compare(left Version, right Version) int {