From f1c76c4dde81b40effe651cf895a58b3decb6be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Fri, 8 Nov 2024 20:30:50 +0800 Subject: [PATCH] Fix deprecated version check --- experimental/deprecated/constants.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/experimental/deprecated/constants.go b/experimental/deprecated/constants.go index 34ea5fc3..44918857 100644 --- a/experimental/deprecated/constants.go +++ b/experimental/deprecated/constants.go @@ -24,10 +24,10 @@ func (n Note) Impending() bool { return false } versionMinor := semver.Compare(semver.MajorMinor("v"+C.Version), "v"+n.ScheduledVersion) - if versionMinor < 0 { + if semver.Prerelease("v"+C.Version) == "" && versionMinor > 0 { panic("invalid deprecated note: " + n.Name) } - return versionMinor <= 1 + return versionMinor >= -1 } func (n Note) Message() string {