Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 17e3852

Browse files
you're doing great
1 parent 13719da commit 17e3852

File tree

127 files changed

+330
-345
lines changed

Some content is hidden

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

127 files changed

+330
-345
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package main
22

33
import (
4-
"net/http"
54
"io"
5+
"net/http"
66
)
77

88
func main() {
@@ -12,4 +12,4 @@ func main() {
1212

1313
func index(w http.ResponseWriter, r *http.Request) {
1414
io.WriteString(w, "Hello world")
15-
}
15+
}

‎000_temp/44_class/13_interface/cache/main.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ type Cache interface {
44
Set(k string, val interface{})
55
Get(k string) interface{}
66
}
7-

‎000_temp/44_class/13_interface/main.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package main
22

33
import (
4-
"github.com/GoesToEleven/golang-web-dev/000_temp/44_class/13_interface/memcache"
54
"github.com/GoesToEleven/golang-web-dev/000_temp/44_class/13_interface/cmd"
5+
"github.com/GoesToEleven/golang-web-dev/000_temp/44_class/13_interface/memcache"
66
)
77

88
func main() {

‎000_temp/44_class/14_data-structure/main.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
type person struct {
88
first string
9-
last string
9+
last string
1010
}
1111

1212
type secretAgent struct {
@@ -47,4 +47,4 @@ func main() {
4747
}
4848
sa1.greeting()
4949
sayMore(sa1)
50-
}
50+
}

‎000_temp/44_class/15/main.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package main
22

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

99
func init() {
@@ -18,4 +18,4 @@ func main() {
1818

1919
func index(w http.ResponseWriter, r *http.Request) {
2020
io.WriteString(w, "Hello world")
21-
}
21+
}

‎000_temp/45_pagination/main.go‎

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
package main
22

33
import (
4+
"fmt"
45
"html/template"
56
"net/http"
6-
"fmt"
77
"strconv"
88
)
99

1010
type Env struct {
11-
Data []int
12-
From int
13-
To int
14-
Amount int
15-
ForwardStart int
11+
Data []int
12+
From int
13+
To int
14+
Amount int
15+
ForwardStart int
1616
BackwardStart int
1717
}
1818

1919
var tpl *template.Template
2020
var xi []int
2121

22-
2322
func init() {
2423
tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
2524
}
@@ -62,7 +61,7 @@ func index(w http.ResponseWriter, r *http.Request) {
6261
// then the next group of records would start at "to"
6362
// but only if there are such records
6463
var fs int
65-
if to+recordsPerPageToShow <= len(xi) {
64+
if to+recordsPerPageToShow <= len(xi) {
6665
fs = to
6766
} else {
6867
fs = len(xi) - recordsPerPageToShow
@@ -73,22 +72,22 @@ func index(w http.ResponseWriter, r *http.Request) {
7372
// then the previous group of records would start at "from" minus ten (records shown)
7473
// but only if there are such records
7574
var bs int
76-
if from-recordsPerPageToShow >= 0 {
75+
if from-recordsPerPageToShow >= 0 {
7776
bs = from - recordsPerPageToShow
7877
} else {
7978
bs = 0
8079
}
8180

8281
data := Env{
83-
Data: xx,
84-
From: from,
85-
To: to - 1,
86-
Amount: recordsPerPageToShow,
87-
ForwardStart: fs,
82+
Data: xx,
83+
From: from,
84+
To: to - 1,
85+
Amount: recordsPerPageToShow,
86+
ForwardStart: fs,
8887
BackwardStart: bs,
8988
}
9089
err = tpl.ExecuteTemplate(w, "index.gohtml", data)
9190
if err != nil {
9291
fmt.Println(err)
9392
}
94-
}
93+
}

‎000_temp/46_sp17/01/main.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package main
22

33
import (
4-
"net/http"
54
"io"
5+
"net/http"
66
)
77

88
func main() {

‎000_temp/46_sp17/02/main.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ func main() {
1010

1111
func foo() {
1212
fmt.Println("hello")
13-
}
13+
}

‎000_temp/46_sp17/03_handle_handler_handlefunc/01_handle/main.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package main
22

33
import (
4-
"net/http"
54
"io"
5+
"net/http"
66
)
77

88
type hotdog int
99

10-
func(hotdog) ServeHTTP(w http.ResponseWriter, r *http.Request) {
10+
func(hotdog) ServeHTTP(w http.ResponseWriter, r *http.Request) {
1111
io.WriteString(w, "Hello from hotdogger")
1212
}
1313

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package main
22

33
import (
4-
"net/http"
54
"io"
5+
"net/http"
66
)
77

88
func main() {
@@ -12,4 +12,4 @@ func main() {
1212

1313
func foo(w http.ResponseWriter, r *http.Request) {
1414
io.WriteString(w, "Hello from hotdiggity dogger")
15-
}
15+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /