Skip to content

Commit f0ecdf3

Browse files
committed
Merge branch 'master' of github.com:XANi/toolbox
2 parents 1a2f43d + 4357847 commit f0ecdf3

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

project-templates/go-goji/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ func main() {
3636
mux := goji.NewMux()
3737
mux.Handle(pat.Get("/static/*"), http.StripPrefix("/static", http.FileServer(http.Dir(`public/static`))))
3838
mux.Handle(pat.Get("/apidoc/*"), http.StripPrefix("/apidoc", http.FileServer(http.Dir(`public/apidoc`))))
39-
mux.HandleFuncC(pat.Get("/"), renderer.HandleRoot)
40-
mux.HandleFuncC(pat.Get("/status"), renderer.HandleStatus)
41-
http.ListenAndServe(listenAddr, mux)
39+
mux.HandleFunc(pat.Get("/"), renderer.HandleRoot)
40+
mux.HandleFunc(pat.Get("/status"), renderer.HandleStatus)
41+
log.Warningf("listening on %s", listenAddr)
42+
log.Errorf("failed on %s", http.ListenAndServe(listenAddr, mux))
4243
}

project-templates/go-goji/web/render.go

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

33
import (
44
"html/template"
5-
"golang.org/x/net/context"
65
"net/http"
76
"goji.io/pat"
87
"github.com/op/go-logging"
@@ -30,20 +29,20 @@ func New() (r *Renderer,err error) {
3029
}
3130

3231

33-
func (r *Renderer) Handle(ctx context.Context, w http.ResponseWriter, req *http.Request) {
34-
page := pat.Param(ctx, "page")
35-
r.HandlePage(page,ctx,w,req)
32+
func (r *Renderer) Handle( w http.ResponseWriter, req *http.Request) {
33+
page := pat.Param(req, "page")
34+
r.HandlePage(page,w,req)
3635
}
37-
func (r *Renderer) HandleRoot(ctx context.Context, w http.ResponseWriter, req *http.Request) {
36+
func (r *Renderer) HandleRoot( w http.ResponseWriter, req *http.Request) {
3837
page := `index.html`
39-
r.HandlePage(page,ctx,w,req)
38+
r.HandlePage(page,w,req)
4039
}
4140

42-
func (r *Renderer) HandleStatus(ctx context.Context, w http.ResponseWriter, req *http.Request) {
41+
func (r *Renderer) HandleStatus( w http.ResponseWriter, req *http.Request) {
4342
r.render.JSON(w, http.StatusOK, map[string]bool{"ok": true})
4443
}
4544

46-
func (r *Renderer) HandlePage(page string,ctx context.Context, w http.ResponseWriter, req *http.Request) {
45+
func (r *Renderer) HandlePage(page string, w http.ResponseWriter, req *http.Request) {
4746
t, err := r.getTpl(page)
4847
if err != nil {
4948
fmt.Fprintf(w, "Page %s not found, err:[%+v]",page,err)

project-templates/perl-carton/lib/.placeholder

Whitespace-only changes.

project-templates/perl-carton/t/.placeholder

Whitespace-only changes.

0 commit comments

Comments
 (0)