From d4a936cb17005dbc071dcab523349ac0d2cff6c7 Mon Sep 17 00:00:00 2001 From: NoahLan <6995syu@163.com> Date: Fri, 18 Aug 2023 10:17:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=BAStrToBool=E6=B7=BB=E5=8A=A0"t"?= =?UTF-8?q?=E5=92=8C"f"=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/convert/bool.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/convert/bool.go b/internal/convert/bool.go index 7220dd5..d6139fa 100644 --- a/internal/convert/bool.go +++ b/internal/convert/bool.go @@ -28,9 +28,9 @@ func ToBool(v any) (bool, error) { func StrToBool(s string) (bool, error) { lower := strings.ToLower(s) switch lower { - case "1", "on", "yes", "true": + case "1", "on", "yes", "true", "t": return true, nil - case "0", "off", "no", "false": + case "0", "off", "no", "false", "f": return false, nil }