Thursday, December 7, 2023
HomeSoftware EngineeringLoop Perpetually in Golang

Loop Perpetually in Golang


If you might want to loop endlessly, or infinitely, in your Go code, then you could have 2 choices:

Choice 1:

for {
  // your code right here
}

Choice 2:

for true {
  // your code right here
}

Simply do not forget that you might want to escape of this, in any other case it actually will run endlessly!

use in a Go Software

bundle foremost

func foremost() {

  // OPTION 1
  for {
    // your code right here
  }

  // OPTION 2
  for true {
    // your code right here
  }

}
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments