()
| 179 | } |
| 180 | |
| 181 | func ExampleDebugHandler_KVFunc() { |
| 182 | mux := http.NewServeMux() |
| 183 | dbg := Debugger(mux) |
| 184 | // Adds an count of page renders to /debug/. Note this example |
| 185 | // isn't concurrency-safe. |
| 186 | views := 0 |
| 187 | dbg.KVFunc("Debug pageviews", func() any { |
| 188 | views = views + 1 |
| 189 | return views |
| 190 | }) |
| 191 | dbg.KV("Donuts", 42) |
| 192 | } |
| 193 | |
| 194 | func ExampleDebugHandler_URL() { |
| 195 | mux := http.NewServeMux() |