@@ -22,7 +22,6 @@ type routeTest struct {
2222 shouldMatch bool // whether the request is expected to match the route at all
2323}
2424
25-
2625func 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) {
673672func 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-
702700type TestA301ResponseWriter struct {
703- hh http.Header
704- status int
701+ hh http.Header
702+ status int
705703}
706704
707705func (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