Skip to content

Commit

Permalink
修复file相关函数未正确返回错误问题
Browse files Browse the repository at this point in the history
  • Loading branch information
qwenode committed May 18, 2021
1 parent 984eeee commit 2230c78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func WriteFileAppend(filename string, content []byte) error {
return err
}
_, err = f.Write(content)
if err1 := f.Close(); err == nil {
if err1 := f.Close(); err1 == nil {
err = err1
}

Expand All @@ -67,7 +67,7 @@ func PutContents(filename string, content []byte) error {
return err
}
_, err = f.Write(content)
if err1 := f.Close(); err == nil {
if err1 := f.Close(); err1 == nil {
err = err1
}

Expand Down

0 comments on commit 2230c78

Please sign in to comment.