Skip to content

Commit 15a41b4

Browse files
committed
using pointers to Route
1 parent 740c09d commit 15a41b4

File tree

12 files changed

+23
-23
lines changed

12 files changed

+23
-23
lines changed

auth-basic-custom/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func main() {
8585
},
8686
}
8787
handler.SetRoutes(
88-
rest.Route{"GET", "/countries", GetAllCountries},
88+
&rest.Route{"GET", "/countries", GetAllCountries},
8989
)
9090
http.ListenAndServe(":8080", &handler)
9191
}

auth-basic/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func main() {
2929
},
3030
}
3131
handler.SetRoutes(
32-
rest.Route{"GET", "/countries", GetAllCountries},
32+
&rest.Route{"GET", "/countries", GetAllCountries},
3333
)
3434
http.ListenAndServe(":8080", &handler)
3535
}

cors-custom/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func main() {
8989
},
9090
}
9191
handler.SetRoutes(
92-
rest.Route{"GET", "/countries", GetAllCountries},
92+
&rest.Route{"GET", "/countries", GetAllCountries},
9393
)
9494
http.ListenAndServe(":8080", &handler)
9595
}

cors/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func main() {
2929
},
3030
}
3131
handler.SetRoutes(
32-
rest.Route{"GET", "/countries", GetAllCountries},
32+
&rest.Route{"GET", "/countries", GetAllCountries},
3333
)
3434
http.ListenAndServe(":8080", &handler)
3535
}

countries/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ func main() {
2626
EnableRelaxedContentType: true,
2727
}
2828
handler.SetRoutes(
29-
rest.Route{"GET", "/countries", GetAllCountries},
30-
rest.Route{"POST", "/countries", PostCountry},
31-
rest.Route{"GET", "/countries/:code", GetCountry},
32-
rest.Route{"DELETE", "/countries/:code", DeleteCountry},
29+
&rest.Route{"GET", "/countries", GetAllCountries},
30+
&rest.Route{"POST", "/countries", PostCountry},
31+
&rest.Route{"GET", "/countries/:code", GetCountry},
32+
&rest.Route{"DELETE", "/countries/:code", DeleteCountry},
3333
)
3434
http.ListenAndServe(":8080", &handler)
3535
}

gae/gaecountries/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ func init() {
2424

2525
handler := rest.ResourceHandler{}
2626
handler.SetRoutes(
27-
rest.Route{"GET", "/countries", GetAllCountries},
28-
rest.Route{"POST", "/countries", PostCountry},
29-
rest.Route{"GET", "/countries/:code", GetCountry},
30-
rest.Route{"DELETE", "/countries/:code", DeleteCountry},
27+
&rest.Route{"GET", "/countries", GetAllCountries},
28+
&rest.Route{"POST", "/countries", PostCountry},
29+
&rest.Route{"GET", "/countries/:code", GetCountry},
30+
&rest.Route{"DELETE", "/countries/:code", DeleteCountry},
3131
)
3232
http.Handle("/", &handler)
3333
}

gorm/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ func main() {
3333
EnableRelaxedContentType: true,
3434
}
3535
handler.SetRoutes(
36-
rest.RouteObjectMethod("GET", "/reminders", &api, "GetAllReminders"),
37-
rest.RouteObjectMethod("POST", "/reminders", &api, "PostReminder"),
38-
rest.RouteObjectMethod("GET", "/reminders/:id", &api, "GetReminder"),
39-
rest.RouteObjectMethod("PUT", "/reminders/:id", &api, "PutReminder"),
40-
rest.RouteObjectMethod("DELETE", "/reminders/:id", &api, "DeleteReminder"),
36+
&rest.RouteObjectMethod("GET", "/reminders", &api, "GetAllReminders"),
37+
&rest.RouteObjectMethod("POST", "/reminders", &api, "PostReminder"),
38+
&rest.RouteObjectMethod("GET", "/reminders/:id", &api, "GetReminder"),
39+
&rest.RouteObjectMethod("PUT", "/reminders/:id", &api, "PutReminder"),
40+
&rest.RouteObjectMethod("DELETE", "/reminders/:id", &api, "DeleteReminder"),
4141
)
4242
http.ListenAndServe(":8080", &handler)
4343
}

helloworld/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type Message struct {
1919
func main() {
2020
handler := rest.ResourceHandler{}
2121
handler.SetRoutes(
22-
rest.Route{
22+
&rest.Route{
2323
"GET",
2424
"/message",
2525
func(w rest.ResponseWriter, req *rest.Request) {

spdy/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func GetUser(w rest.ResponseWriter, req *rest.Request) {
3232
func main() {
3333
handler := rest.ResourceHandler{}
3434
handler.SetRoutes(
35-
rest.Route{"GET", "/users/:id", GetUser},
35+
&rest.Route{"GET", "/users/:id", GetUser},
3636
)
3737
log.Fatal(spdy.ListenAndServeTCP(":8080", &handler))
3838
}

status-auth/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ func main() {
3131
},
3232
}
3333
handler.SetRoutes(
34-
rest.Route{"GET", "/countries", GetAllCountries},
35-
rest.Route{"GET", "/.status",
34+
&rest.Route{"GET", "/countries", GetAllCountries},
35+
&rest.Route{"GET", "/.status",
3636
auth.MiddlewareFunc(
3737
func(w rest.ResponseWriter, r *rest.Request) {
3838
w.WriteJson(handler.GetStatus())

0 commit comments

Comments
 (0)