Correct logic where we add a space after the prefix when logging

This commit is contained in:
Christian Rocha 2021-03-01 18:05:53 -05:00
parent fbd32c6eee
commit cd676fab5a
No known key found for this signature in database
GPG Key ID: D6CC7A16E5878018
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ func LogToFile(path string, prefix string) (*os.File, error) {
// doesn't already have a trailing space.
if len(prefix) > 0 {
finalChar := prefix[len(prefix)-1]
if unicode.IsSpace(rune(finalChar)) {
if !unicode.IsSpace(rune(finalChar)) {
prefix += " "
}
}