如何使用Go将多个字符串解析为模板?

Is there a simple way like template.ParseFiles("base.html", "home.html") but for strings to build a template from a set of strings?

I have a base template and a list of pages templates (all as strings) that I want to build on top of base template.

I figured out how to merge them, but I my solution is quite verbose and doesn't look elegant enough, even though working.

查看全部
dqt20140129
dqt20140129
2017/01/25 15:55
  • templates
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复