A quit channel signals concurrent goroutines that shared work is complete and they should stop. In a concurrent maze solver, it replaces using the solution value both as data and as a stop flag, avoiding a data race and simplifying control flow. section 9.5.2
Use the channel with Go's select statement:
- Declare a signal-only channel such as quit: make(chan struct{}); the empty structure carries no meaningful payload. section 9.5.2
- Select between receiving quit and receiving new work, returning when the quit case becomes ready. section 9.5.2
