sync.Mutex

We’re also using a sync.Mutex (a mutual exclusion lock) to prevent our Logger instance making multiple writes concurrently. Without this mutex lock, it’s possible that the content of multiple log entries would be written at exactly the same time and be mixed up in the output, rather than each entry being written in full on its own line.