go: add while loop example (#1583)
This commit is contained in:
parent
b27d7d7f55
commit
f7f77ad479
12
go.md
12
go.md
|
@ -233,6 +233,18 @@ for i, val := range entry {
|
||||||
|
|
||||||
See: [For-Range loops](https://gobyexample.com/range)
|
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
|
## Functions
|
||||||
{: .-three-column}
|
{: .-three-column}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue