Skip to content

Commit

Permalink
Add code comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
edoger committed May 10, 2021
1 parent 443d075 commit b85fa39
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions file_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func (w *fileWriter) swap() {
internal.EchoError("Failed to sync log file %s: %s.", w.name, err)
return
}
// On the windows platform, the file must be closed before renaming the file.
if err := w.fd.Close(); err != nil {
// We need to ignore the error that the file is closed.
if e, ok := err.(*os.PathError); !ok || e.Err != os.ErrClosed {
Expand Down

0 comments on commit b85fa39

Please sign in to comment.