码迷,mamicode.com
首页 > 其他好文 > 详细

golang 模版 管道

时间:2014-09-10 11:00:50      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:io   java   ar   log   html   c   ad   new   htm   

//读取模板template/index.html的内容

b, err := ioutil.ReadFile(“template/index.html”)
if err != nil {

log.Println(err)

}
s := string(b)
t, _ := template.New(““).Funcs(template.FuncMap{“ShowS”:strings.Title}).Parse(s)

golang 模版 管道

标签:io   java   ar   log   html   c   ad   new   htm   

原文地址:http://my.oschina.net/beloser/blog/311897

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!