From 5667bfb9f0f56f82099efc0bb848472a37aaab28 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Thu, 9 Mar 2017 15:35:09 +0200 Subject: [PATCH] Fix http://support.iris-go.com/d/22-template-binary-problem-in-v6 Former-commit-id: 8bdd9ba4d2a8ebb04d28fe03f2869269bae7b04e --- adaptors/view/_examples/template_binary/bindata.go | 7 ++++--- adaptors/view/_examples/template_binary/main.go | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/adaptors/view/_examples/template_binary/bindata.go b/adaptors/view/_examples/template_binary/bindata.go index 2d995fb7..e298f99a 100644 --- a/adaptors/view/_examples/template_binary/bindata.go +++ b/adaptors/view/_examples/template_binary/bindata.go @@ -3,6 +3,7 @@ // templates/hi.html // DO NOT EDIT! +// NOTE: execute your own look main.go package main import ( @@ -83,7 +84,7 @@ func templatesHiHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "templates/hi.html", size: 106, mode: os.FileMode(438), modTime: time.Unix(1468907204, 0)} + info := bindataFileInfo{name: "templates/hi.html", size: 106, mode: os.FileMode(438), modTime: time.Unix(1487682349, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -184,8 +185,8 @@ type bintree struct { } var _bintree = &bintree{nil, map[string]*bintree{ - "templates": {nil, map[string]*bintree{ - "hi.html": {templatesHiHtml, map[string]*bintree{}}, + "templates": &bintree{nil, map[string]*bintree{ + "hi.html": &bintree{templatesHiHtml, map[string]*bintree{}}, }}, }} diff --git a/adaptors/view/_examples/template_binary/main.go b/adaptors/view/_examples/template_binary/main.go index 05882ac4..adfaafd9 100644 --- a/adaptors/view/_examples/template_binary/main.go +++ b/adaptors/view/_examples/template_binary/main.go @@ -11,10 +11,11 @@ func main() { app.Adapt(iris.DevLogger()) app.Adapt(httprouter.New()) - //$ go-bindata ./templates/... + // $ go-bindata ./templates/... + // $ go build + // $ ./template_binary // templates are not used, you can delete the folder and run the example app.Adapt(view.HTML("./templates", ".html").Binary(Asset, AssetNames)) - app.Get("/hi", hi) app.Listen(":8080") }