mirror of
https://github.com/vbatts/talks.git
synced 2024-12-25 16:16:30 +00:00
25 lines
390 B
Go
25 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
|
|
}
|