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:
1 parent
b1d727ebaf
commit
f037a112b2
2 files changed
+2
-2
No files matched your search
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