gh-pages-flowControl-forLoops

Add the description for the For Loops and For-Range loops.
This commit is contained in:
Paul Rosset 2018-08-07 17:47:31 +01:00 committed by GitHub
parent b27d794063
commit 8e092aaaee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

21
go.md
View File

@ -198,6 +198,27 @@ switch day {
See: [Switch](https://github.com/golang/go/wiki/Switch) See: [Switch](https://github.com/golang/go/wiki/Switch)
### For loop
```go
for count := 0; count <= 10; count++ {
fmt.Println("My counter is at", count)
}
```
See: [For loops](https://tour.golang.org/flowcontrol/1)
### For-Range loop
```go
entry := []string{"Jack","John","Jones"}
for i, val := range entry {
fmt.Printf("At position %d, the character %s is present\n", i, val)
}
```
See: [For-Range loops](https://gobyexample.com/range)
## Functions ## Functions
{: .-three-column} {: .-three-column}