Skip to content

Commit d78345c

Browse files
committed
adds memcache for templates
1 parent 6ce8659 commit d78345c

File tree

373 files changed

+905
-992
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

373 files changed

+905
-992
lines changed

Diff for: 01_getting-started/01_helloWorld/firstFile.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ so in my GOPATH you will see it pointing to:
1515
1616
GOPATH="/Users/tm002/Documents/go"
1717
18-
*/
18+
*/

Diff for: 02_package/stringutil/reverse.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ go build
1313
1414
go install
1515
will place the package inside the pkg directory of the workspace.
16-
*/
16+
*/

Diff for: 03_variables/01_shorthand/01/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ func main() {
1919
fmt.Printf("%v \n", e)
2020
fmt.Printf("%v \n", f)
2121
fmt.Printf("%v \n", g)
22-
}
22+
}

Diff for: 03_variables/01_shorthand/02/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ func main() {
1919
fmt.Printf("%T \n", e)
2020
fmt.Printf("%T \n", f)
2121
fmt.Printf("%T \n", g)
22-
}
22+
}

Diff for: 03_variables/02_var_zero-value/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ func main() {
1515
fmt.Printf("%v \n", d)
1616

1717
fmt.Println()
18-
}
18+
}

Diff for: 03_variables/03_less-emphasis/03_init-many-at-once/var.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ func main() {
88
var a, b, c int = 1, 2, 3
99

1010
fmt.Println(message, a, b, c)
11-
}
11+
}

Diff for: 03_variables/03_less-emphasis/04_infer-type/var.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ func main() {
88
var a, b, c = 1, 2, 3
99

1010
fmt.Println(message, a, b, c)
11-
}
11+
}

Diff for: 03_variables/03_less-emphasis/05_infer-mixed-up-types/var.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ func main() {
88
var a, b, c = 1, false, 3
99

1010
fmt.Println(message, a, b, c)
11-
}
11+
}

Diff for: 03_variables/03_less-emphasis/06_init-shorthand/var.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ func main() {
1111
e := true
1212

1313
fmt.Println(message, a, b, c, d, e)
14-
}
14+
}

Diff for: 03_variables/03_less-emphasis/07_all-together/variables.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ package main
33
import "fmt"
44

55
var a string = "this is stored in the variable a" // package scope
6-
var b, c string = "stored in b", "stored in c" // package scope
7-
var d string // package scope
6+
var b, c string = "stored in b", "stored in c" // package scope
7+
var d string // package scope
88

99
func main() {
1010

1111
d = "stored in d" // declaration above; assignment here; package scope
12-
var e int = 42 // function scope - subsequent variables have same package scope:
12+
var e int = 42 // function scope - subsequent variables have same package scope:
1313
f := 43
1414
g := "stored in g"
1515
h, i := "stored in h", "stored in i"
1616
j, k, l, m := 44.7, true, false, 'm' // single quotes
17-
n := "n" // double quotes
18-
o := `o` // back ticks
17+
n := "n" // double quotes
18+
o := `o` // back ticks
1919

2020
fmt.Println("a - ", a)
2121
fmt.Println("b - ", b)
@@ -32,4 +32,4 @@ func main() {
3232
fmt.Println("m - ", m)
3333
fmt.Println("n - ", n)
3434
fmt.Println("o - ", o)
35-
}
35+
}

Diff for: 03_variables/03_less-emphasis/08_exercise_your-name/01_oneSolution/myNameVar.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import "fmt"
44

55
var name string = "Todd"
66

7-
func main(){
7+
func main() {
88
fmt.Println("Hello ", name)
99
}

Diff for: 03_variables/03_less-emphasis/08_exercise_your-name/02_anotherSolution/myNameVar.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package main
22

33
import "fmt"
44

5-
func main(){
5+
func main() {
66
var name string = "Todd"
77
fmt.Println("Hello ", name)
88
}

Diff for: 03_variables/03_less-emphasis/08_exercise_your-name/03_anotherSolution/myNameVar.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package main
22

33
import "fmt"
44

5-
func main(){
5+
func main() {
66
name := "Todd"
77
fmt.Println("Hello ", name)
88
}

Diff for: 03_variables/03_less-emphasis/08_exercise_your-name/04_anotherSolution/myNameVar.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package main
22

33
import "fmt"
44

5-
func main(){
5+
func main() {
66
name := `Todd` // back-ticks work like double-quotes
77
fmt.Println("Hello ", name)
88
}

Diff for: 04_scope/02_block-scope/02_closure/01/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ func main() {
1111
fmt.Println(y)
1212
}
1313
// fmt.Println(y) // outside scope of y
14-
}
14+
}

Diff for: 04_scope/02_block-scope/02_closure/02/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ func main() {
1818
closure helps us limit the scope of variables used by multiple functions
1919
without closure, for two or more funcs to have access to the same variable,
2020
that variable would need to be package scope
21-
*/
21+
*/

Diff for: 04_scope/02_block-scope/02_closure/03/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "fmt"
44

55
func main() {
66
x := 0
7-
increment := func () int {
7+
increment := func() int {
88
x++
99
return x
1010
}
@@ -22,4 +22,4 @@ a function without a name
2222
2323
func expression
2424
assigning a func to a variable
25-
*/
25+
*/

Diff for: 04_scope/03_order-matters/main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ func main() {
77
fmt.Println(y)
88
x := 42
99
}
10-
var y = 42
10+
11+
var y = 42

Diff for: 05_blank-identifier/01_invalid-code/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ func main() {
77
b := "stored in b"
88
fmt.Println("a - ", a)
99
// b is not being used - invalid code
10-
}
10+
}

Diff for: 05_blank-identifier/02_http-get_example/01_with-error-checking/main.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package main
22

33
import (
4-
"net/http"
5-
"log"
6-
"io/ioutil"
74
"fmt"
5+
"io/ioutil"
6+
"log"
7+
"net/http"
88
)
99

1010
func main() {
@@ -18,4 +18,4 @@ func main() {
1818
log.Fatal(err)
1919
}
2020
fmt.Printf("%s", page)
21-
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package main
22

33
import (
4-
"net/http"
5-
"io/ioutil"
64
"fmt"
5+
"io/ioutil"
6+
"net/http"
77
)
88

99
func main() {
1010
res, _ := http.Get("http://www.mcleods.com/")
1111
page, _ := ioutil.ReadAll(res.Body)
1212
res.Body.Close()
1313
fmt.Printf("%s", page)
14-
}
14+
}

Diff for: 06_constants/01_constant/main.go

-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ func main() {
1313
}
1414

1515
// a CONSTANT is a simple unchanging value
16-

Diff for: 06_constants/03_iota/main.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ package main
33
import "fmt"
44

55
const (
6-
A = iota // 0
7-
B = iota // 1
8-
C = iota // 2
6+
A = iota // 0
7+
B = iota // 1
8+
C = iota // 2
99
)
1010

1111
func main() {
1212
fmt.Println(A)
1313
fmt.Println(B)
1414
fmt.Println(C)
15-
}
15+
}

Diff for: 06_constants/04_iota/main.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ package main
33
import "fmt"
44

55
const (
6-
A = iota // 0
7-
B // 1
8-
C // 2
6+
A = iota // 0
7+
B // 1
8+
C // 2
99
)
1010

1111
func main() {
1212
fmt.Println(A)
1313
fmt.Println(B)
1414
fmt.Println(C)
15-
}
15+
}

Diff for: 06_constants/05_iota/main.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ package main
33
import "fmt"
44

55
const (
6-
A = iota // 0
7-
B // 1
8-
C // 2
6+
A = iota // 0
7+
B // 1
8+
C // 2
99
)
1010

1111
const (
12-
D = iota // 0
13-
E // 1
14-
F // 2
12+
D = iota // 0
13+
E // 1
14+
F // 2
1515
)
1616

1717
func main() {
@@ -21,4 +21,4 @@ func main() {
2121
fmt.Println(D)
2222
fmt.Println(E)
2323
fmt.Println(F)
24-
}
24+
}

Diff for: 06_constants/06_iota/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package main
33
import "fmt"
44

55
const (
6-
_ = iota // 0
6+
_ = iota // 0
77
B = iota * 10 // 1 * 10
88
C = iota * 10 // 2 * 10
99
)
1010

1111
func main() {
1212
fmt.Println(B)
1313
fmt.Println(C)
14-
}
14+
}

Diff for: 06_constants/07_iota/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import "fmt"
44

55
const (
6-
_ = iota // 0
6+
_ = iota // 0
77
KB = 1 << (iota * 10) // 1 << (1 * 10)
88
MB = 1 << (iota * 10) // 1 << (2 * 10)
99
GB = 1 << (iota * 10) // 1 << (3 * 10)
@@ -20,4 +20,4 @@ func main() {
2020
fmt.Printf("%d\n", GB)
2121
fmt.Printf("%b\t", TB)
2222
fmt.Printf("%d\n", TB)
23-
}
23+
}

Diff for: 07_memory-address/01_showing-address/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ func main() {
99
fmt.Println("a - ", a)
1010
fmt.Println("a's memory address - ", &a)
1111
fmt.Printf("%d \n", &a)
12-
}
12+
}

Diff for: 07_memory-address/02_using-address/main.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import "fmt"
44

55
const metersToYards float64 = 1.09361
66

7-
func main(){
8-
var meters float64
9-
fmt.Print("Enter meters swam: ")
10-
fmt.Scan(&meters)
11-
yards := meters * metersToYards
12-
fmt.Println(meters, " meters is ", yards, " yards.")
13-
}
7+
func main() {
8+
var meters float64
9+
fmt.Print("Enter meters swam: ")
10+
fmt.Scan(&meters)
11+
yards := meters * metersToYards
12+
fmt.Println(meters, " meters is ", yards, " yards.")
13+
}

Diff for: 08_pointers/01_referencing/main.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ func main() {
1111
fmt.Println(a)
1212
fmt.Println(&a)
1313

14-
1514
var b *int = &a
1615

1716
fmt.Println(b)
1817

1918
// the above code makes b a pointer to the memory address where an int is stored
2019
// b is of type "int pointer"
2120
// *int -- the * is part of the type -- b is of type *int
22-
}
21+
}

Diff for: 08_pointers/02_dereferencing/main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ func main() {
66

77
a := 43
88

9-
fmt.Println(a) // 43
9+
fmt.Println(a) // 43
1010
fmt.Println(&a) // 0x20818a220
1111

1212
var b *int = &a
13-
fmt.Println(b) // 0x20818a220
14-
fmt.Println(*b) // 43
13+
fmt.Println(b) // 0x20818a220
14+
fmt.Println(*b) // 43
1515

1616
// b is an int pointer;
1717
// b points to the memory address where an int is stored

Diff for: 08_pointers/03_using-pointers/main.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ func main() {
66

77
a := 43
88

9-
fmt.Println(a) // 43
9+
fmt.Println(a) // 43
1010
fmt.Println(&a) // 0x20818a220
1111

1212
var b *int = &a
13-
fmt.Println(b) // 0x20818a220
14-
fmt.Println(*b) // 43
13+
fmt.Println(b) // 0x20818a220
14+
fmt.Println(*b) // 43
1515

16-
*b = 42 // b says, "The value at this address, change it to 42"
16+
*b = 42 // b says, "The value at this address, change it to 42"
1717
fmt.Println(a) // 42
1818

1919
// this is useful

0 commit comments

Comments
 (0)