Skip to content

Commit

Permalink
Merge branch 'rjbernaldo-feature/ammend-while'
Browse files Browse the repository at this point in the history
* rjbernaldo-feature/ammend-while:
  Add emulated solution for while in go
  • Loading branch information
miguelmota committed Mar 3, 2019
2 parents 33d00ac + b4b9bea commit 8d9c02f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ Output

#### Go

(there is no *while* in Go)
While there is no *while* in Go, we have found an emulated answer via https://yourbasic.org/golang/do-while-loop/

```go
package main
Expand All @@ -660,10 +660,8 @@ import "fmt"

func main() {
i := 0

for i <= 5 {
for ok := true; ok; ok = i <= 5 {
fmt.Println(i)

i++
}
}
Expand Down

0 comments on commit 8d9c02f

Please sign in to comment.