1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/shxsun-gosuv

Клонировать/Скачать
res_nobindata.go 507
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
codeskyblue Отправлено 31.08.2016 06:12 554bba9
// +build !bindata
package main
import (
"html/template"
"io"
"io/ioutil"
"net/http"
"path/filepath"
)
func init() {
fs := http.FileServer(http.Dir(templateDir))
http.Handle("/res/", http.StripPrefix("/res/", fs))
}
func executeTemplate(wr io.Writer, name string, data interface{}) {
path := filepath.Join(templateDir, name+".html")
body, err := ioutil.ReadFile(path)
if err != nil {
panic(err)
}
template.Must(template.New("t").Delims("[[", "]]").Parse(string(body))).Execute(wr, data)
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/shxsun-gosuv.git
git@api.gitlife.ru:oschina-mirror/shxsun-gosuv.git
oschina-mirror
shxsun-gosuv
shxsun-gosuv
master