Bones 是 Go 语言用于开发 Web 应用的模板引擎,包含一些很好的设计模式。支持 CSRF。
示例模板:
<h2>Login</h2> {{template "errors.html" .}} <form action="/login" method="post"> {{.CsrfTokenField}} <fieldset> <label for="email" class="label-required">Email</label> <input type="email" id="email" name="email" class="input-medium"> <label for="password" class="label-required">Password</label> <input type="password" id="password" name="password" class="input-medium"> </fieldset> <input type="submit" value="Login"> </form>