The mutex makes sure you don’t read from the log while writing to it. You could have n concurrent readers without needing a mutex, if only you were sure no one is writing to it. Actually, this is a scenario for sync.RWMutex. Its docs explain it well: “The lock can be held by an arbitrary number of readers or a single writer”.
1 Like