示例#1
0
文件: main.go 项目: CNDonny/scope
// Retrieve the context value and render the chained handlers context page.
func renderContextPage(w handlers.GhostWriter, r *http.Request) {
	err := templates.Render("templates/amber/context.amber",
		w, &struct{ Val string }{w.Context()[contextPageKey].(string)})
	if err != nil {
		panic(err)
	}
}
示例#2
0
文件: main.go 项目: CNDonny/scope
// Prepare the context value for the chained handlers context page.
func setContext(w handlers.GhostWriter, r *http.Request) {
	w.Context()[contextPageKey] = time.Now().String()
}