func handleRequest(w http.ResponseWriter, r *http.Request) { ctx := context.Background() mp := miniprofiler_gae.New(ctx, w, r) defer mp.Close() // ... }
func handleRequest(w http.ResponseWriter, r *http.Request) { ctx := context.Background() mp := miniprofiler_gae.FromContext(ctx) if mp != nil { // ... } // ... }This example demonstrates how to retrieve an existing MiniProfiler instance from the request context using the `FromContext` function. This can be useful for accessing profiling data in middleware or other handlers downstream in the request chain.