Skip to content

Commit

Permalink
Add simple Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
bittersweet committed May 23, 2016
1 parent 5a1bf05 commit 4847bd2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
all:
@@go build
linux:
@@GOOS=linux GOARCH=386 go build
10 changes: 5 additions & 5 deletions endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import (
"github.com/jmoiron/sqlx/types"
)

type previewData struct {
Template string `json:"template"`
Data types.JSONText `json:"data"`
}

func trackTime(start time.Time, name string) {
elapsed := time.Since(start)
log.Printf("%s took %s\n", name, elapsed)
Expand Down Expand Up @@ -42,11 +47,6 @@ func handleCount(es elasticsearch.ElasticsearchClient) http.Handler {
})
}

type previewData struct {
Template string `json:"template"`
Data types.JSONText `json:"data"`
}

func handlePreview() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
defer trackTime(time.Now(), "handlePreview")
Expand Down

0 comments on commit 4847bd2

Please sign in to comment.