Fix more race conditions found by race detector
This commit is contained in:
2
stats.go
2
stats.go
@@ -254,7 +254,7 @@ func writeStats() error {
|
||||
statsFile := filepath.Join(config.ourBinaryDir, "stats.json")
|
||||
log.Printf("Writing JSON file: %s", statsFile)
|
||||
statistics.RLock()
|
||||
json, err := json.MarshalIndent(statistics, "", " ")
|
||||
json, err := json.MarshalIndent(&statistics, "", " ")
|
||||
statistics.RUnlock()
|
||||
if err != nil {
|
||||
log.Printf("Couldn't generate JSON: %s", err)
|
||||
|
||||
Reference in New Issue
Block a user