Prompt Refactor

Go Goroutine Safety

Audit and fix concurrency issues with mutexes, channels, and sync primitives.

goconcurrency
Insert label Goroutine Safety
Prompt

Audit this Go code for concurrency safety. Protect shared state with sync.Mutex or sync.RWMutex, replace unsafe shared memory with channels where appropriate, ensure goroutines are properly cancelled and cleaned up, and check for race conditions.

Add this to your Facet Inserts in Crystl for one-click access.

Get Crystl