After coming unstuck with Golang code that worked differently between an IDE and a terminal, then fixing it with some sleep, I decided to look into how the scheduling works.
I found some very useful stuff.
Part 1, 2 and 3 are excellent: https://www.ardanlabs.com/blog/2018/08/scheduling-in-go-part1.html
I read in Part two these words:
"The Go scheduler is part of the Go runtime, and the Go runtime is built into your application. This means the Go scheduler runs in user space, above the kernel. The current implementation of the Go scheduler is not a preemptive scheduler but a cooperating scheduler. Being a cooperating scheduler means the scheduler needs well-defined user space events that happen at safe points in the code to make scheduling decisions."