From 7348bb6f884d49985a213894dec2059c929c1597 Mon Sep 17 00:00:00 2001 From: caixw Date: Thu, 9 Nov 2023 14:08:42 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=88=A0=E9=99=A4=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E7=9A=84=20fmt.Sprintf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- colors/colors.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/colors/colors.go b/colors/colors.go index c712f62..de01d1a 100644 --- a/colors/colors.go +++ b/colors/colors.go @@ -15,7 +15,6 @@ package colors import ( - "fmt" "math" "strconv" @@ -145,7 +144,7 @@ func RGB(r, g, b uint8) Color { // - HEX("ababab") ==> RGB(0xab, 0xab, 0xab) func HEX(hex string) Color { if len(hex) == 0 { - panic(fmt.Sprintf("无效的参数 hex")) + panic("无效的参数 hex") } if hex[0] == '#' { @@ -157,7 +156,7 @@ func HEX(hex string) Color { hex = string([]byte{hex[0], hex[0], hex[1], hex[1], hex[2], hex[2]}) case 6: default: - panic(fmt.Sprintf("无效的参数 hex")) + panic("无效的参数 hex") } c, err := strconv.ParseInt(hex, 16, 32)