Skip to content

Commit 0b25551

Browse files
committed
gofmt
1 parent cda806d commit 0b25551

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func NewCookie(name string, value string, age int64) *http.Cookie {
9191
return &http.Cookie{Name: name, Value: value, Expires: utctime}
9292
}
9393

94-
// GetBasicAuth is a helper method of *Context that returns the decoded
94+
// GetBasicAuth is a helper method of *Context that returns the decoded
9595
// user and password from the *Context's authorization header
9696
func (ctx *Context) GetBasicAuth() (string, string, error) {
9797
authHeader := ctx.Request.Header["Authorization"][0]

server.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package web
22

33
import (
44
"bytes"
5+
"code.google.com/p/go.net/websocket"
56
"crypto/tls"
67
"fmt"
78
"log"
@@ -15,7 +16,6 @@ import (
1516
"runtime"
1617
"strconv"
1718
"time"
18-
"code.google.com/p/go.net/websocket"
1919
)
2020

2121
// ServerConfig is configuration for server objects.
@@ -72,14 +72,14 @@ func (s *Server) addRoute(r string, method string, handler interface{}) {
7272
}
7373

7474
switch handler.(type) {
75-
case http.Handler:
76-
s.routes = append(s.routes, route{r: r, cr: cr, method: method, httpHandler: handler.(http.Handler)})
77-
case reflect.Value:
78-
fv := handler.(reflect.Value)
79-
s.routes = append(s.routes, route{r: r, cr: cr, method: method, handler: fv})
80-
default:
81-
fv := reflect.ValueOf(handler)
82-
s.routes = append(s.routes, route{r: r, cr: cr, method: method, handler: fv})
75+
case http.Handler:
76+
s.routes = append(s.routes, route{r: r, cr: cr, method: method, httpHandler: handler.(http.Handler)})
77+
case reflect.Value:
78+
fv := handler.(reflect.Value)
79+
s.routes = append(s.routes, route{r: r, cr: cr, method: method, handler: fv})
80+
default:
81+
fv := reflect.ValueOf(handler)
82+
s.routes = append(s.routes, route{r: r, cr: cr, method: method, handler: fv})
8383
}
8484
}
8585

web.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package web
44

55
import (
66
"bytes"
7+
"code.google.com/p/go.net/websocket"
78
"crypto/hmac"
89
"crypto/sha1"
910
"crypto/tls"
@@ -19,7 +20,6 @@ import (
1920
"strconv"
2021
"strings"
2122
"time"
22-
"code.google.com/p/go.net/websocket"
2323
)
2424

2525
// A Context object is created for every incoming HTTP request, and is

web_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,8 @@ func TestDuplicateHeader(t *testing.T) {
531531
}
532532

533533
func BuildBasicAuthCredentials(user string, pass string) string {
534-
s := user + ":" + pass
535-
return "Basic "+base64.StdEncoding.EncodeToString([]byte(s))
534+
s := user + ":" + pass
535+
return "Basic " + base64.StdEncoding.EncodeToString([]byte(s))
536536
}
537537

538538
func BenchmarkProcessGet(b *testing.B) {

0 commit comments

Comments
 (0)