While True Loop in Go
While loops do not actually exist within Go (golang), by name, but the same functionality is achievable with a for loop. Which is great, why have a ‘while’ when the same can be done with ‘for’.
Our example below shows how you get a Go program to print out a message every second to the screen. (You’ll have to exit to application to stop it, e.g. Ctrl+C)