// 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) } }
// Prepare the context value for the chained handlers context page. func setContext(w handlers.GhostWriter, r *http.Request) { w.Context()[contextPageKey] = time.Now().String() }