Permalink
Browse files

Updating to new templates package for weekly.2011-08-17

  • Loading branch information...
1 parent a141d6c commit 3c286b227d9adc7c6462697d894fd8dc1da4b3ee @paulbellamy committed Aug 20, 2011
Showing with 3 additions and 3 deletions.
  1. +2 −2 show_errors.go
  2. +1 −1 show_errors_test.go
View
@@ -11,14 +11,14 @@ func ShowErrors(templateString string) Middleware {
<html>
<body>
<p>
- {Error|html}
+ {{.Error|html}}
</p>
</body>
</html>
`
}
- errorTemplate := template.MustParse(templateString, nil)
+ errorTemplate := template.Must(template.New("error").Parse(templateString))
return func(env Env, app App) (status Status, headers Headers, body Body) {
defer func() {
View
@@ -18,7 +18,7 @@ func init() {
func TestShowErrors(t *testing.T) {
// Compile the stack
showErrorsStack := new(Stack)
- showErrorsStack.Middleware(ShowErrors("<html><body>{Error|html}</body></html>"))
+ showErrorsStack.Middleware(ShowErrors("<html><body>{{.Error|html}}</body></html>"))
showErrorsApp := showErrorsStack.Compile(showErrorsTestServer)
// Request against it

0 comments on commit 3c286b2

Please sign in to comment.