From f037a112b2e7ff7123147f81dc0da126c8cda342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E6=99=BA=E8=B6=850668000959?= Date: Sun, 7 Jun 2026 12:08:16 +0800 Subject: [PATCH] fix: avoid err shadow in feishu close check Use distinct variable names (writeErr, closeErr) to avoid shadowing the outer err, so a deferred close failure is still captured. --- .gitignore | Bin 920 -> 940 bytes pkg/channels/feishu/feishu_64.go | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index bd9730001a44d52a97d1cd249b0b4c87c166c9c1..dbcb620b46dee451a3e6731e03546a771ff4d0f2 100644 GIT binary patch delta 29 lcmbQizJ{Io{qFr6W-tr#a_N=l7iE_erKT3^^K$WW0RW|C38Mf2 delta 8 PcmZ3(K7)ND^9*JH4NL-} diff --git a/pkg/channels/feishu/feishu_64.go b/pkg/channels/feishu/feishu_64.go index d812d8f65..6bffc9e29 100644 --- a/pkg/channels/feishu/feishu_64.go +++ b/pkg/channels/feishu/feishu_64.go @@ -1013,9 +1013,9 @@ func (c *FeishuChannel) storeResourceFile( }) return "" } - if err := out.Close(); err != nil { + if closeErr := out.Close(); closeErr != nil { logger.ErrorCF("feishu", "Failed to close downloaded resource file", map[string]any{ - "error": err.Error(), + "error": closeErr.Error(), }) os.Remove(localPath) return ""