source generates a web page containing source code annotated with profile data.
(w http.ResponseWriter, req *http.Request)
| 406 | // source generates a web page containing source code annotated with profile |
| 407 | // data. |
| 408 | func (ui *webInterface) source(w http.ResponseWriter, req *http.Request) { |
| 409 | args := []string{"weblist", req.URL.Query().Get("f")} |
| 410 | rpt, errList := ui.makeReport(w, req, args, nil) |
| 411 | if rpt == nil { |
| 412 | return // error already reported |
| 413 | } |
| 414 | |
| 415 | // Generate source listing. |
| 416 | listing, err := report.MakeWebList(rpt, ui.options.Obj, maxEntries) |
| 417 | if err != nil { |
| 418 | http.Error(w, err.Error(), http.StatusBadRequest) |
| 419 | ui.options.UI.PrintErr(err) |
| 420 | return |
| 421 | } |
| 422 | |
| 423 | legend := report.ProfileLabels(rpt) |
| 424 | ui.render(w, req, "sourcelisting", rpt, errList, legend, webArgs{ |
| 425 | Listing: listing, |
| 426 | }) |
| 427 | } |
| 428 | |
| 429 | // peek generates a web page listing callers/callers. |
| 430 | func (ui *webInterface) peek(w http.ResponseWriter, req *http.Request) { |
nothing calls this directly
no test coverage detected