How to return from a function when a timer finishes in go?
I’m new to go and working on a toy quiz cli program. I’m trying to implement a timer such that when the timer finishes, the quiz is over. This is my initial implementation. func StartTimer(quizFinished chan bool, timer *time.Timer) { // Start timer <-timer.C fmt.Println(“\nQuiz has ended”) quizFinished <- true return } func askQuestions(timer *time.Timer, … Read more