Difference between using or not using go to call functions [SOLVED]

Whatsapp the difference between calling a funcionar like that;

go anyroutine()

And

anyroutine()

https://tour.golang.org/concurrency/1

3 Likes

This runs anyrountine() in a new goroutine.

This runs anyrountine() in the current goroutine.

1 Like

Something like a parallel thread?

Goroutines are like lightweight user space threads. They are similar to the idea of coroutines, but we call them goroutines.

There is an entry in the tour about Go’s concurrency features. Check it out.

https://tour.golang.org/concurrency/1

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.