内置的"html/template"或"mustache",我应该使用哪一个?

huangapple go评论88阅读模式
英文:

Built-in "html/template" or "mustache", which one shall I use?

问题

我是新手,想要使用golang来构建一个web应用程序。

我发现它内置了html/template,可以使用指定的数据渲染html模板,还有一个mustache的移植版本似乎也不错。

我不确定应该使用哪个。请给我一些建议或者对它们进行比较,以便让我做出决定,谢谢。

英文:

I'm new to golang, and want to use it to build a web app.

I found it has built-in html/template, which can render html template with specified data, and there is also a mustache port which seems good.

I'm not sure which one shall I use. Please give me some advices or comparations between them to let me decide, thank you.

答案1

得分: 5

我更喜欢使用html/template,因为它包含在Go库中,并且具有简单的设计。

您可以在下一个Web应用程序中看到它的强大之处:

https://bitbucket.org/jzs/sketchground/src

英文:

I prefer use html/template because it comes in Go library, and by its simple design.

You can see in the next web application how powerfull it is:

https://bitbucket.org/jzs/sketchground/src

答案2

得分: 2

我更喜欢html/template。它使用起来很简单。这里的代码演示<http://golang.org/doc/articles/wiki/>可以作为一个起点。

英文:

I prefer html/template. Its simple to use. The codewalk here <http://golang.org/doc/articles/wiki/> can be a start.

huangapple
  • 本文由 发表于 2012年5月27日 22:57:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/10774886.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定