Merge pull request #6113 from thaJeztah/config_suppress_err
cli/config/configfile: explicitly ignore error
This commit is contained in:
commit
a007d1ae24
@ -152,7 +152,8 @@ func (configFile *ConfigFile) Save() (retErr error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
temp.Close()
|
// ignore error as the file may already be closed when we reach this.
|
||||||
|
_ = temp.Close()
|
||||||
if retErr != nil {
|
if retErr != nil {
|
||||||
if err := os.Remove(temp.Name()); err != nil {
|
if err := os.Remove(temp.Name()); err != nil {
|
||||||
logrus.WithError(err).WithField("file", temp.Name()).Debug("Error cleaning up temp file")
|
logrus.WithError(err).WithField("file", temp.Name()).Debug("Error cleaning up temp file")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user