1
0
mirror of https://github.com/docker/cli.git synced 2026-01-13 18:22:35 +03:00

Merge pull request #6113 from thaJeztah/config_suppress_err

cli/config/configfile: explicitly ignore error
This commit is contained in:
Paweł Gronowski
2025-05-28 12:08:37 +00:00
committed by GitHub

View File

@@ -152,7 +152,8 @@ func (configFile *ConfigFile) Save() (retErr error) {
return err
}
defer func() {
temp.Close()
// ignore error as the file may already be closed when we reach this.
_ = temp.Close()
if retErr != nil {
if err := os.Remove(temp.Name()); err != nil {
logrus.WithError(err).WithField("file", temp.Name()).Debug("Error cleaning up temp file")