mirror of
https://github.com/vbatts/talks.git
synced 2025-06-02 01:52:30 +00:00
2016-12: brush up this talk for an intro
This commit is contained in:
parent
1b8e5c7a36
commit
68f582d393
18 changed files with 513 additions and 0 deletions
25
2016/12-intro-to-golang/primitive1.go
Normal file
25
2016/12-intro-to-golang/primitive1.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
// +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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue