Logo

Programming-Idioms

History of Idiom 78 > diff from v35 to v36

Edit summary for version 36 by :
New Go implementation by user [gdey]

Version 35

2015-12-18, 20:36:13

Version 36

2016-01-01, 20:20:41

Idiom #78 "do while" loop

Execute a block once, then execute it again as long as boolean condition c is true.

Idiom #78 "do while" loop

Execute a block once, then execute it again as long as boolean condition c is true.

Code
for{
   someThing()
   …
   someOtherThing()
   if !c {
     break
   }
}
Doc URL
https://golang.org/ref/spec#For_statements
Demo URL
http://play.golang.org/p/aNVIjY8oVK