Render templates via a buffer, not the ResponseWriter (closes #123)
All checks were successful
check / check (push) Superseded by a newer commit; never tested
All checks were successful
check / check (push) Superseded by a newer commit; never tested
This commit was merged in pull request #131.
This commit is contained in:
@@ -1,6 +1,19 @@
|
||||
package handlers
|
||||
|
||||
import "net/http"
|
||||
import (
|
||||
"html/template"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// AddTemplateForTest registers a template under a page name so that
|
||||
// the handlers_test package can drive the render path with a
|
||||
// template of its own.
|
||||
func (s *Handlers) AddTemplateForTest(
|
||||
pageTemplate string,
|
||||
tmpl *template.Template,
|
||||
) {
|
||||
s.templates[pageTemplate] = tmpl
|
||||
}
|
||||
|
||||
// RenderTemplateForTest exposes renderTemplate for use in the
|
||||
// handlers_test package.
|
||||
|
||||
Reference in New Issue
Block a user