mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
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:
BIN
Binary file not shown.
@@ -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 ""
|
||||
|
||||
Reference in New Issue
Block a user