0
votes

I'm learning go routines and trying to implement a program that calls the Connect function and if this function managed to work for X seconds the program logs "Success", otherwise "failure". Here is the function itself:

func Connect() {
    time.Sleep(5 * time.Second)
}

Can you tell me how to implement such a program using go routines?