Skip to content

Commit

Permalink
go: add while loop example (rstacruz#1583)
Browse files Browse the repository at this point in the history
  • Loading branch information
destag authored Dec 3, 2020
1 parent b27d7d7 commit f7f77ad
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions go.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,18 @@ for i, val := range entry {

See: [For-Range loops](https://gobyexample.com/range)

### While loop

```go
n := 0
x := 42
for n != x {
n := guess()
}
```

See: [Go's "while"](https://tour.golang.org/flowcontrol/3)

## Functions
{: .-three-column}

Expand Down

0 comments on commit f7f77ad

Please sign in to comment.