mirror of
https://github.com/vbatts/talks.git
synced 2024-12-26 00:26:30 +00:00
26 lines
390 B
Go
26 lines
390 B
Go
|
// +build ignore
|
||
|
|
||
|
package main
|
||
|
|
||
|
import "fmt"
|
||
|
|
||
|
func main() {
|
||
|
// START1 OMIT
|
||
|
names := []string{
|
||
|
"Michael",
|
||
|
"Jan",
|
||
|
"Sean",
|
||
|
"Silvia",
|
||
|
}
|
||
|
for i, name := range names {
|
||
|
fmt.Printf("%q is the %d name\n", name, i)
|
||
|
}
|
||
|
for i := range names {
|
||
|
fmt.Printf("%q is the %d name\n", names[i], i)
|
||
|
}
|
||
|
for _, name := range names {
|
||
|
fmt.Printf("%q is the ... name\n", name)
|
||
|
}
|
||
|
// STOP1 OMIT
|
||
|
}
|