index work

This commit is contained in:
Mark McGranaghan 2012-09-23 14:43:33 -07:00
parent 4fc6a1c9a7
commit 9ef3140839
7 changed files with 9 additions and 12 deletions

View File

@ -1,14 +1,11 @@
// ## Literals // ## Inline Assignment
package main package main
import "fmt" import "fmt"
func main() { func main() {
// `x := val` is shorthand for `var x type = val`. // `x := val` is shorthand for `var x type = val`.
x := "Hello literal" x := "Hello assignment"
fmt.Println(x) fmt.Println(x)
} }
// todo: literal term?

View File

@ -0,0 +1,2 @@
$ go run inline-assignment.go
Hello assignment

View File

@ -1,2 +0,0 @@
$ go run literal.go
Hello literal

View File

@ -1,2 +0,0 @@
$ go run case.go
Write 3 as three

View File

@ -1,4 +1,4 @@
// ## Case // ## Switch
package main package main

2
008-switch/switch.sh Normal file
View File

@ -0,0 +1,2 @@
$ go run switch.go
Write 3 as three

View File

@ -6,11 +6,11 @@
hello-world hello-world
values values
variables variables
literals inline-assignment
constants constants
for for
if-else if-else
case switch
arrays arrays
range range
slices slices