From 448b472c533600d6ea7b2e997b52c3980cea1786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Wed, 27 Dec 2023 18:20:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=AF=94=E8=BE=83,=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0ignore=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tool/version.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tool/version.go b/tool/version.go index 01a78e1..9120ed2 100644 --- a/tool/version.go +++ b/tool/version.go @@ -86,3 +86,13 @@ func (v *version) Compare(versionOne string, versionTwo string, strictMode bool) wrapper.Int(define.VersionTwoMax), ).ToInt().Value, nil } + +// CompareIgnoreError 忽略error +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 18:20 2023/12/27 +func (v *version) CompareIgnoreError(versionOne string, versionTwo string, strictMode bool) int { + res, _ := v.Compare(versionOne, versionTwo, strictMode) + return res +}