Loading tickets/tickets_test.go +3 −3 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ func TestTicketsComplex(t *testing.T) { t.Logf("number of tickets: %d", maxTickets) t.Logf("numWorkers: %d", numWorkers) // gernerate some work // generate some tickets totalProcessDuration := time.Duration(0) ticketStream := make(chan *Ticket, numBuffered) go func(numTickets int) { Loading @@ -80,7 +80,7 @@ func TestTicketsComplex(t *testing.T) { } }(maxTickets) // dispatch work to distinct workers // dispatch work to distinct goroutines workerResultStreamArray := make([]chan WorkerResult, numWorkers) for workerIndex := 0; workerIndex < numWorkers; workerIndex++ { workerResultStreamArray[workerIndex] = func(id int, ticketStream chan *Ticket) chan WorkerResult { Loading @@ -105,7 +105,7 @@ func TestTicketsComplex(t *testing.T) { }(workerIndex, ticketStream) } // collect results from all workers // collect results from all goroutines workerResultStream := make(chan WorkerResult) go func() { defer close(workerResultStream) Loading Loading
tickets/tickets_test.go +3 −3 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ func TestTicketsComplex(t *testing.T) { t.Logf("number of tickets: %d", maxTickets) t.Logf("numWorkers: %d", numWorkers) // gernerate some work // generate some tickets totalProcessDuration := time.Duration(0) ticketStream := make(chan *Ticket, numBuffered) go func(numTickets int) { Loading @@ -80,7 +80,7 @@ func TestTicketsComplex(t *testing.T) { } }(maxTickets) // dispatch work to distinct workers // dispatch work to distinct goroutines workerResultStreamArray := make([]chan WorkerResult, numWorkers) for workerIndex := 0; workerIndex < numWorkers; workerIndex++ { workerResultStreamArray[workerIndex] = func(id int, ticketStream chan *Ticket) chan WorkerResult { Loading @@ -105,7 +105,7 @@ func TestTicketsComplex(t *testing.T) { }(workerIndex, ticketStream) } // collect results from all workers // collect results from all goroutines workerResultStream := make(chan WorkerResult) go func() { defer close(workerResultStream) Loading