A Go HTTP server can handle a new request before an earlier handler finishes. Each request runs in a goroutine, so handlers that share state must account for concurrent access. Run tests with `go test -race` when checking for races. section 8.2.1
Protect a shared solution
Several maze-exploring goroutines may find the treasure and try to write `s.solution`. Lock a mutex before checking whether the field is nil and setting it; unlock when the operation is done. A separate `solutionFound` function uses the same mutex when reading the field. Protecting the write alone would leave the shared read unprotected. section 9.3.5
The solution field also acts as a signal for explorers to stop. This is a quick approach, not a complete shutdown design: whether the solver stops deadlocking can still depend on the maze. A cache that must support concurrent stores, reads, and deletes presents another shared-state problem to test. section 9.3.5 section 7.0



















