mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
fix: embed of static, views
This commit is contained in:
@@ -19,7 +19,7 @@ func Init() {
|
||||
var templates map[string]*template.Template
|
||||
|
||||
func loadTemplates() {
|
||||
tplPath := "/views"
|
||||
const tplPath = "/views"
|
||||
tpls := template.New("").Funcs(template.FuncMap{
|
||||
"json": utils.Json,
|
||||
"date": utils.FormatDateHuman,
|
||||
@@ -46,10 +46,10 @@ func loadTemplates() {
|
||||
templates = make(map[string]*template.Template)
|
||||
|
||||
dir, err := pkger.Open(tplPath)
|
||||
defer dir.Close()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer dir.Close()
|
||||
files, err := dir.Readdir(0)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
Reference in New Issue
Block a user