From 55791536141ef19446504ec4149d703955d8ba9f Mon Sep 17 00:00:00 2001 From: Gerasimos Maropoulos Date: Tue, 26 Jul 2016 18:36:03 +0300 Subject: [PATCH] Fix the call to pointer on .UseTemplate(...).Directory(..).Binary(...) --- README.md | 7 +------ context.go | 2 +- template.go | 4 ++-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1b43f0ee..4788cfde 100644 --- a/README.md +++ b/README.md @@ -21,17 +21,12 @@ Platforms

-
The fastest backend web framework, written entirely in Go.
Easy to learn, while it's highly customizable.
Ideally suited for both experienced and novice Developers.
- - - - -

+

Installation diff --git a/context.go b/context.go index 97bf620a..dca4a5fa 100644 --- a/context.go +++ b/context.go @@ -472,7 +472,7 @@ func (ctx *Context) Gzip(b []byte, status int) { // Note: the options: "gzip" and "charset" are built'n support by Iris, so you can pass these on any template engine or response engine func (ctx *Context) RenderWithStatus(status int, name string, binding interface{}, options ...map[string]interface{}) error { ctx.SetStatusCode(status) - if strings.IndexByte(name, '.') > 0 { //we have template + if strings.IndexByte(name, '.') > -1 { //we have template return ctx.framework.templates.getBy(name).execute(ctx, name, binding, options...) } return ctx.framework.responses.getBy(name).render(ctx, binding, options...) diff --git a/template.go b/template.go index a6b9922b..5387166c 100644 --- a/template.go +++ b/template.go @@ -103,10 +103,10 @@ type ( // Directory sets the directory to load from // returns the Binary location which is optional -func (t *TemplateEngineLocation) Directory(dir string, fileExtension string) TemplateEngineBinaryLocation { +func (t *TemplateEngineLocation) Directory(dir string, fileExtension string) *TemplateEngineBinaryLocation { t.directory = dir t.extension = fileExtension - return TemplateEngineBinaryLocation{location: t} + return &TemplateEngineBinaryLocation{location: t} } // Binary sets the asset(s) and asssets names to load from, works with Directory