From b85fa39c07e15fc945903fa301541a55036e24e7 Mon Sep 17 00:00:00 2001 From: Qingshan Luo Date: Mon, 10 May 2021 18:53:58 +0800 Subject: [PATCH] Add code comments. --- file_writer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/file_writer.go b/file_writer.go index d6b64dc..f49e4ed 100644 --- a/file_writer.go +++ b/file_writer.go @@ -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 {