diff options
Diffstat (limited to 'src/edit/views.go')
-rw-r--r-- | src/edit/views.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/edit/views.go b/src/edit/views.go index 74d8006..d5ad985 100644 --- a/src/edit/views.go +++ b/src/edit/views.go @@ -1,12 +1,12 @@ package main import ( + "bytes" "io" "mime" - "util" - "bytes" "path" "strings" + "util" ) var ( @@ -15,13 +15,13 @@ var ( tmplViewBlob = util.NewTemplate("got/view_blob.got") tmplModified = util.NewTemplate("got/modified.got") tmplDeleted = util.NewTemplate("got/deleted.got") -) +) func renderPage(w io.Writer, title, head, body string) error { return tmplPage.Execute(w, map[string]string{ "title": title, - "head": head, - "body": body, + "head": head, + "body": body, }) } @@ -42,7 +42,7 @@ func renderViewTree(w io.Writer, upath string, tree GitTree) error { // Component Render var buf bytes.Buffer err := tmplViewTree.Execute(&buf, map[string]interface{}{ - "path": upath, + "path": upath, "files": files, }) if err != nil { @@ -61,8 +61,8 @@ func renderViewBlob(w io.Writer, upath string, file GitFile) error { // Component render var buf bytes.Buffer err = tmplViewBlob.Execute(&buf, map[string]string{ - "path": upath, - "ctype": mime.TypeByExtension(path.Ext(upath)), + "path": upath, + "ctype": mime.TypeByExtension(path.Ext(upath)), "content": string(content), }) if err != nil { |