status.go 257 Bytes BlameHistoryPermalink Edit 1 2 3 4 5 6 7 8 9 10 11 12 13 package render import ( "context" "net/http" ) var statusCtxKey = &contextKey{"Status"} // Status sets status into request context. func Status(r *http.Request, status int) { *r = *r.WithContext(context.WithValue(r.Context(), statusCtxKey, status)) }