From d0dbba0156bc9cc41958c1e5acc30a9480641ca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Fri, 24 Jan 2025 15:58:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DValidatorRule.String=E6=96=B9?= =?UTF-8?q?=E6=B3=95NPE=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- validator.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/validator.go b/validator.go index d6363a5..60bdc47 100644 --- a/validator.go +++ b/validator.go @@ -12,6 +12,9 @@ package consts type ValidatorRule string // 验证规则 func (vr *ValidatorRule) String() string { + if nil == vr { + return "" + } return string(*vr) }