File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ package main
2+
3+ import "fmt" ;
4+
5+ func main () {
6+
7+ /**
8+ * `for` loop
9+ *
10+ * for [assignment]; [conditions]; [increment/decrement] { ... }
11+ */
12+ for i := 0 ; i < 10 ; i ++ {
13+
14+ /**
15+ * loop will break; once i is greater than 4
16+ */
17+ if i > 4 {
18+ break ;
19+ }
20+
21+ fmt .Println ("i =" , i )
22+ }
23+
24+ }
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import "fmt" ;
4+
5+ func main () {
6+
7+ /**
8+ * `for` loop
9+ *
10+ * for [assignment]; [conditions]; [increment/decrement] { ... }
11+ */
12+ for i := 0 ; i < 10 ; i ++ {
13+
14+ /**
15+ * loop will continue; once i is greater than 5
16+ */
17+ if i > 5 {
18+ continue ;
19+ }
20+
21+ /**
22+ * this will get skipped once i is greate then 5;
23+ */
24+ fmt .Println ("i =" , i )
25+ }
26+
27+ }
You can’t perform that action at this time.
0 commit comments