Created
November 5, 2019 21:21
-
-
Save kjk/1206d992a950885e9ba867de8e222a68 to your computer and use it in GitHub Desktop.
infinite for loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// :collection Essential Go | |
package main | |
import "fmt" | |
func main() { | |
// :show start | |
i := 0 | |
for { | |
fmt.Printf("i: %d\n", i) | |
i += 2 | |
if i >= 5 { | |
break | |
} | |
} | |
// :show end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment