I have a main function that looks like so:
func main() {
go SyncRealTime()
go SyncStale()
}
Both of these functions are supposed to continue indefinitely. I'd like for main
to:
- Not terminate as long as both Goroutines are running.
- Terminate if either one of the Goroutines terminates (i.e. errors)
What is the idiomatic way of doing that in Go?