func TemplateField(c web.C, r *http.Request) template.HTML {
	fragment := fmt.Sprintf(`<input type="hidden" name="%s" value="%s">`,
		c.Env[formKey], Token(c, r))
	return template.HTML(fragment)
}
TemplateField is a template helper for html/template that provides an <input> field
populated with a CSRF token.

Example:

// The following tag in our form.tmpl template:
{{ .csrfField }}

// ... becomes:
<input type="hidden" name="goji.csrf.Token" value="<token>">
package csrf
import (
	"crypto/rand"
	"crypto/subtle"
	"encoding/base64"
	"fmt"
	"html/template"
	"net/http"
	"net/url"
	"github.com/zenazn/goji/web"
)
func Token(c web.C, r *http.Request) string {
	if maskedToken, ok := c.Env[tokenKey].(string); ok {
		return maskedToken
	}
	return ""
}
func FailureReason(c web.C, r *http.Request) error {
	if err, ok := c.Env[errorKey].(error); ok {
		return err
	}
	return nil
}