Can anyone explain the difference between the following two calls regarding the goroutines?
Method 1
fmt.Println("Starting srv")
go LOGGER.Error(srv.ListenAndServe())
fmt.Println("Starting intSrv")
go LOGGER.Error(intSrv.ListenAndServe())
This stopes after executing the "Starting srv"
Method 2
go func() {
fmt.Println("Starting srv")
srv.ListenAndServe()
}()
go func() {
fmt.Println("Starting intSrv")
intSrv.ListenAndServe()
}()
This executes both "Starting srv" and "Starting intSrv"
Why the behaviour is different?