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.
This commit is contained in:
程智超0668000959 committed 2026-06-07 20:35:57 +08:00
1 parent b1d727ebaf
commit f037a112b2
2 files changed
+2 -2

No files matched your search

BIN
View File
Binary file not shown.
+2 -2
View File
@@ -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 ""