Fix

"concurrent map writes" Panic in Go

Fix the 'concurrent map writes' panic by wrapping map access in a sync.Mutex to serialize operations.

The panic occurs because multiple goroutines are writing to the same map without synchronization. Wrap all map writes (and reads if concurrent) in a sync.Mutex to ensure only one goroutine accesses the map at a time.

var (
	mu   sync.Mutex
	data = make(map[string]int)
)

// Safe write
mu.Lock()
data[key] = value
mu.Unlock()

// Safe read
mu.Lock()
val := data[key]
mu.Unlock()