Skip to content

Commit

Permalink
adds memcache for templates
Browse files Browse the repository at this point in the history
  • Loading branch information
GoesToEleven committed Oct 27, 2015
1 parent 6ce8659 commit d78345c
Show file tree
Hide file tree
Showing 373 changed files with 905 additions and 992 deletions.
2 changes: 1 addition & 1 deletion 01_getting-started/01_helloWorld/firstFile.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ so in my GOPATH you will see it pointing to:
GOPATH="/Users/tm002/Documents/go"
*/
*/
2 changes: 1 addition & 1 deletion 02_package/stringutil/reverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ go build
go install
will place the package inside the pkg directory of the workspace.
*/
*/
2 changes: 1 addition & 1 deletion 03_variables/01_shorthand/01/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ func main() {
fmt.Printf("%v \n", e)
fmt.Printf("%v \n", f)
fmt.Printf("%v \n", g)
}
}
2 changes: 1 addition & 1 deletion 03_variables/01_shorthand/02/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ func main() {
fmt.Printf("%T \n", e)
fmt.Printf("%T \n", f)
fmt.Printf("%T \n", g)
}
}
2 changes: 1 addition & 1 deletion 03_variables/02_var_zero-value/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ func main() {
fmt.Printf("%v \n", d)

fmt.Println()
}
}
2 changes: 1 addition & 1 deletion 03_variables/03_less-emphasis/03_init-many-at-once/var.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ func main() {
var a, b, c int = 1, 2, 3

fmt.Println(message, a, b, c)
}
}
2 changes: 1 addition & 1 deletion 03_variables/03_less-emphasis/04_infer-type/var.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ func main() {
var a, b, c = 1, 2, 3

fmt.Println(message, a, b, c)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ func main() {
var a, b, c = 1, false, 3

fmt.Println(message, a, b, c)
}
}
2 changes: 1 addition & 1 deletion 03_variables/03_less-emphasis/06_init-shorthand/var.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ func main() {
e := true

fmt.Println(message, a, b, c, d, e)
}
}
12 changes: 6 additions & 6 deletions 03_variables/03_less-emphasis/07_all-together/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ package main
import "fmt"

var a string = "this is stored in the variable a" // package scope
var b, c string = "stored in b", "stored in c" // package scope
var d string // package scope
var b, c string = "stored in b", "stored in c" // package scope
var d string // package scope

func main() {

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

fmt.Println("a - ", a)
fmt.Println("b - ", b)
Expand All @@ -32,4 +32,4 @@ func main() {
fmt.Println("m - ", m)
fmt.Println("n - ", n)
fmt.Println("o - ", o)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import "fmt"

var name string = "Todd"

func main(){
func main() {
fmt.Println("Hello ", name)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import "fmt"

func main(){
func main() {
var name string = "Todd"
fmt.Println("Hello ", name)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import "fmt"

func main(){
func main() {
name := "Todd"
fmt.Println("Hello ", name)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import "fmt"

func main(){
func main() {
name := `Todd` // back-ticks work like double-quotes
fmt.Println("Hello ", name)
}
2 changes: 1 addition & 1 deletion 04_scope/02_block-scope/02_closure/01/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ func main() {
fmt.Println(y)
}
// fmt.Println(y) // outside scope of y
}
}
2 changes: 1 addition & 1 deletion 04_scope/02_block-scope/02_closure/02/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ func main() {
closure helps us limit the scope of variables used by multiple functions
without closure, for two or more funcs to have access to the same variable,
that variable would need to be package scope
*/
*/
4 changes: 2 additions & 2 deletions 04_scope/02_block-scope/02_closure/03/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "fmt"

func main() {
x := 0
increment := func () int {
increment := func() int {
x++
return x
}
Expand All @@ -22,4 +22,4 @@ a function without a name
func expression
assigning a func to a variable
*/
*/
3 changes: 2 additions & 1 deletion 04_scope/03_order-matters/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ func main() {
fmt.Println(y)
x := 42
}
var y = 42

var y = 42
2 changes: 1 addition & 1 deletion 05_blank-identifier/01_invalid-code/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ func main() {
b := "stored in b"
fmt.Println("a - ", a)
// b is not being used - invalid code
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package main

import (
"net/http"
"log"
"io/ioutil"
"fmt"
"io/ioutil"
"log"
"net/http"
)

func main() {
Expand All @@ -18,4 +18,4 @@ func main() {
log.Fatal(err)
}
fmt.Printf("%s", page)
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package main

import (
"net/http"
"io/ioutil"
"fmt"
"io/ioutil"
"net/http"
)

func main() {
res, _ := http.Get("http://www.mcleods.com/")
page, _ := ioutil.ReadAll(res.Body)
res.Body.Close()
fmt.Printf("%s", page)
}
}
1 change: 0 additions & 1 deletion 06_constants/01_constant/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ func main() {
}

// a CONSTANT is a simple unchanging value

8 changes: 4 additions & 4 deletions 06_constants/03_iota/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package main
import "fmt"

const (
A = iota // 0
B = iota // 1
C = iota // 2
A = iota // 0
B = iota // 1
C = iota // 2
)

func main() {
fmt.Println(A)
fmt.Println(B)
fmt.Println(C)
}
}
8 changes: 4 additions & 4 deletions 06_constants/04_iota/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package main
import "fmt"

const (
A = iota // 0
B // 1
C // 2
A = iota // 0
B // 1
C // 2
)

func main() {
fmt.Println(A)
fmt.Println(B)
fmt.Println(C)
}
}
14 changes: 7 additions & 7 deletions 06_constants/05_iota/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package main
import "fmt"

const (
A = iota // 0
B // 1
C // 2
A = iota // 0
B // 1
C // 2
)

const (
D = iota // 0
E // 1
F // 2
D = iota // 0
E // 1
F // 2
)

func main() {
Expand All @@ -21,4 +21,4 @@ func main() {
fmt.Println(D)
fmt.Println(E)
fmt.Println(F)
}
}
4 changes: 2 additions & 2 deletions 06_constants/06_iota/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package main
import "fmt"

const (
_ = iota // 0
_ = iota // 0
B = iota * 10 // 1 * 10
C = iota * 10 // 2 * 10
)

func main() {
fmt.Println(B)
fmt.Println(C)
}
}
4 changes: 2 additions & 2 deletions 06_constants/07_iota/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import "fmt"

const (
_ = iota // 0
_ = iota // 0
KB = 1 << (iota * 10) // 1 << (1 * 10)
MB = 1 << (iota * 10) // 1 << (2 * 10)
GB = 1 << (iota * 10) // 1 << (3 * 10)
Expand All @@ -20,4 +20,4 @@ func main() {
fmt.Printf("%d\n", GB)
fmt.Printf("%b\t", TB)
fmt.Printf("%d\n", TB)
}
}
2 changes: 1 addition & 1 deletion 07_memory-address/01_showing-address/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ func main() {
fmt.Println("a - ", a)
fmt.Println("a's memory address - ", &a)
fmt.Printf("%d \n", &a)
}
}
14 changes: 7 additions & 7 deletions 07_memory-address/02_using-address/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import "fmt"

const metersToYards float64 = 1.09361

func main(){
var meters float64
fmt.Print("Enter meters swam: ")
fmt.Scan(&meters)
yards := meters * metersToYards
fmt.Println(meters, " meters is ", yards, " yards.")
}
func main() {
var meters float64
fmt.Print("Enter meters swam: ")
fmt.Scan(&meters)
yards := meters * metersToYards
fmt.Println(meters, " meters is ", yards, " yards.")
}
3 changes: 1 addition & 2 deletions 08_pointers/01_referencing/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ func main() {
fmt.Println(a)
fmt.Println(&a)


var b *int = &a

fmt.Println(b)

// the above code makes b a pointer to the memory address where an int is stored
// b is of type "int pointer"
// *int -- the * is part of the type -- b is of type *int
}
}
6 changes: 3 additions & 3 deletions 08_pointers/02_dereferencing/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ func main() {

a := 43

fmt.Println(a) // 43
fmt.Println(a) // 43
fmt.Println(&a) // 0x20818a220

var b *int = &a
fmt.Println(b) // 0x20818a220
fmt.Println(*b) // 43
fmt.Println(b) // 0x20818a220
fmt.Println(*b) // 43

// b is an int pointer;
// b points to the memory address where an int is stored
Expand Down
8 changes: 4 additions & 4 deletions 08_pointers/03_using-pointers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ func main() {

a := 43

fmt.Println(a) // 43
fmt.Println(a) // 43
fmt.Println(&a) // 0x20818a220

var b *int = &a
fmt.Println(b) // 0x20818a220
fmt.Println(*b) // 43
fmt.Println(b) // 0x20818a220
fmt.Println(*b) // 43

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

// this is useful
Expand Down
Loading

0 comments on commit d78345c

Please sign in to comment.