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:
parent
b1d727ebaf
commit
f037a112b2
2 changed files with 2 additions and 2 deletions
BIN
.gitignore
vendored
BIN
.gitignore
vendored
Binary file not shown.
|
|
@ -1013,9 +1013,9 @@ func (c *FeishuChannel) storeResourceFile(
|
||||||
})
|
})
|
||||||
return ""
|
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{
|
logger.ErrorCF("feishu", "Failed to close downloaded resource file", map[string]any{
|
||||||
"error": err.Error(),
|
"error": closeErr.Error(),
|
||||||
})
|
})
|
||||||
os.Remove(localPath)
|
os.Remove(localPath)
|
||||||
return ""
|
return ""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue