Since Start and Stop can be called independently in two separate goroutines, it's possible to call Stop before Start executes c.stopped = false. Giving the caller the ability to check the state of the cache will allow them to not return from the goroutine that calls Start until stopped=true.
Since
StartandStopcan be called independently in two separate goroutines, it's possible to callStopbeforeStartexecutesc.stopped = false. Giving the caller the ability to check the state of the cache will allow them to not return from the goroutine that callsStartuntilstopped=true.