go: add while loop example (#1583)

This commit is contained in:
Przemysław Pietras 2020-12-03 09:37:40 +01:00 committed by GitHub
parent b27d7d7f55
commit f7f77ad479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

12
go.md
View File

@ -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}