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
2026-06-07 12:08:16 +08:00
parent b1d727ebaf
commit f037a112b2
2 changed files with 2 additions and 2 deletions
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 ""