1
0
Fork 0
mirror of https://github.com/vbatts/talks.git synced 2024-12-26 00:26:30 +00:00
talks/2015/02-devconf.cz/primitive1.go

26 lines
390 B
Go
Raw Normal View History

2015-02-05 23:58:25 +00:00
// +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
}