1
0
Fork 0
mirror of https://github.com/vbatts/talks.git synced 2024-12-25 16:16:30 +00:00
talks/2015/02-devconf.cz/primitive1.go
2015-02-06 01:04:10 +01:00

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
}