Skip to content

Commit 9ee70e5

Browse files
committed
gofmt
1 parent 9ede152 commit 9ee70e5

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

mux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
6969
if p := cleanPath(req.URL.Path); p != req.URL.Path {
7070

7171
// Added 3 lines (Philip Schlump) - It was droping the query string and #whatever from query.
72-
// This matches with fix in go 1.2 r.c. 4 for same problem. Go Issue:
72+
// This matches with fix in go 1.2 r.c. 4 for same problem. Go Issue:
7373
// http://code.google.com/p/go/issues/detail?id=5252
7474
url := *req.URL
7575
url.Path = p

mux_test.go

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ type routeTest struct {
2222
shouldMatch bool // whether the request is expected to match the route at all
2323
}
2424

25-
2625
func TestHost(t *testing.T) {
2726
// newRequestHost a new request with a method, url, and host header
2827
newRequestHost := func(method, url, host string) *http.Request {
@@ -673,7 +672,7 @@ func testRoute(t *testing.T, test routeTest) {
673672
func TestKeepContext(t *testing.T) {
674673
func1 := func(w http.ResponseWriter, r *http.Request) {}
675674

676-
r:= NewRouter()
675+
r := NewRouter()
677676
r.HandleFunc("/", func1).Name("func1")
678677

679678
req, _ := http.NewRequest("GET", "http://localhost/", nil)
@@ -698,21 +697,20 @@ func TestKeepContext(t *testing.T) {
698697

699698
}
700699

701-
702700
type TestA301ResponseWriter struct {
703-
hh http.Header
704-
status int
701+
hh http.Header
702+
status int
705703
}
706704

707705
func (ho TestA301ResponseWriter) Header() http.Header {
708706
return http.Header(ho.hh)
709707
}
710708

711-
func (ho TestA301ResponseWriter) Write( b []byte) (int, error) {
709+
func (ho TestA301ResponseWriter) Write(b []byte) (int, error) {
712710
return 0, nil
713711
}
714712

715-
func (ho TestA301ResponseWriter) WriteHeader( code int ) {
713+
func (ho TestA301ResponseWriter) WriteHeader(code int) {
716714
ho.status = code
717715
}
718716

@@ -722,16 +720,16 @@ func Test301Redirect(t *testing.T) {
722720
func1 := func(w http.ResponseWriter, r *http.Request) {}
723721
func2 := func(w http.ResponseWriter, r *http.Request) {}
724722

725-
r:= NewRouter()
723+
r := NewRouter()
726724
r.HandleFunc("/api/", func2).Name("func2")
727725
r.HandleFunc("/", func1).Name("func1")
728726

729727
req, _ := http.NewRequest("GET", "http://localhost//api/?abc=def", nil)
730728

731729
res := TestA301ResponseWriter{
732-
hh: m,
733-
status : 0,
734-
}
730+
hh: m,
731+
status: 0,
732+
}
735733
r.ServeHTTP(&res, req)
736734

737735
if "http://localhost/api/?abc=def" != res.hh["Location"][0] {

0 commit comments

Comments
 (0)