From 2f4e52cac53dd43ceddfcde6e638947d4013f186 Mon Sep 17 00:00:00 2001 From: yuguojian <18126816215> Date: Tue, 1 Jul 2025 17:34:53 +0800 Subject: [PATCH] =?UTF-8?q?ip=E7=BC=93=E5=AD=98=E9=85=8D=E7=BD=AE=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=B8=8D=E7=AD=89=E4=BA=8E0=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ip_tool/hua_chen_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip_tool/hua_chen_client.go b/ip_tool/hua_chen_client.go index bcfafa0..a85f701 100644 --- a/ip_tool/hua_chen_client.go +++ b/ip_tool/hua_chen_client.go @@ -114,7 +114,7 @@ func (h *HuaChenIpClient) GetIpInfoFormCache(ctx context.Context, ip string, opt return nil, errors.Wrapf(err, "无法将IP信息转换为JSON,ip:%s", ip) } - if len(opt) == 0 { + if len(opt) != 0 { err = h.cache.Set(ctx, h.ipKey(ip), string(infoJson), opt[0]) if err != nil { return nil, errors.Wrapf(err, "缓存ip:%s信息失败,", ip)