From bb0eff82a60288b205f1ef273f89e498b571c0de Mon Sep 17 00:00:00 2001 From: im7mortal Date: Thu, 14 Apr 2016 00:26:45 +0300 Subject: [PATCH] minor fixes for template_storage --- examples/template-blocks/layouts/default.html | 2 +- examples/template-blocks/main.go | 2 +- examples/template-blocks/views/blocks1.html | 2 +- examples/template-blocks/views/blocks2.html | 2 +- render/template_storage.go | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/template-blocks/layouts/default.html b/examples/template-blocks/layouts/default.html index 71fc468a..a519fce9 100644 --- a/examples/template-blocks/layouts/default.html +++ b/examples/template-blocks/layouts/default.html @@ -7,4 +7,4 @@ {{block "body" .}} {{end}} - \ No newline at end of file + diff --git a/examples/template-blocks/main.go b/examples/template-blocks/main.go index e49003a6..1d0fe2f1 100644 --- a/examples/template-blocks/main.go +++ b/examples/template-blocks/main.go @@ -16,4 +16,4 @@ func main() { func render(c *gin.Context) { c.HTML(200, c.Request.URL.Path, gin.H{}) -} \ No newline at end of file +} diff --git a/examples/template-blocks/views/blocks1.html b/examples/template-blocks/views/blocks1.html index 8b086c00..39c333b8 100644 --- a/examples/template-blocks/views/blocks1.html +++ b/examples/template-blocks/views/blocks1.html @@ -4,4 +4,4 @@ {{define "body"}} Go to blocks 2 -{{end}} \ No newline at end of file +{{end}} diff --git a/examples/template-blocks/views/blocks2.html b/examples/template-blocks/views/blocks2.html index 8938eef7..749d9b64 100644 --- a/examples/template-blocks/views/blocks2.html +++ b/examples/template-blocks/views/blocks2.html @@ -4,4 +4,4 @@ {{define "body"}} Go to blocks 1 -{{end}} \ No newline at end of file +{{end}} diff --git a/render/template_storage.go b/render/template_storage.go index 6afb4110..00e89b5e 100644 --- a/render/template_storage.go +++ b/render/template_storage.go @@ -14,20 +14,20 @@ type TemplateStorage struct { } func (t TemplateStorage) Instance(name string, data interface{}) Render { - return HTMLwithBlock{ + return HTMLWithBlock{ Template: t.Storage[name], Name: name, Data: data, } } -type HTMLwithBlock struct { +type HTMLWithBlock struct { Template *template.Template Name string Data interface{} } -func (r HTMLwithBlock) Render(w http.ResponseWriter) error { +func (r HTMLWithBlock) Render(w http.ResponseWriter) error { writeContentType(w, htmlContentType) return r.Template.Execute(w, r.Data) -} \ No newline at end of file +}