(resp *http.Response)
| 540 | } |
| 541 | |
| 542 | func statusCodeError(resp *http.Response) error { |
| 543 | if resp.Header.Get("X-Go-Pprof") != "" && strings.Contains(resp.Header.Get("Content-Type"), "text/plain") { |
| 544 | // error is from pprof endpoint |
| 545 | if body, err := io.ReadAll(resp.Body); err == nil { |
| 546 | return fmt.Errorf("server response: %s - %s", resp.Status, body) |
| 547 | } |
| 548 | } |
| 549 | return fmt.Errorf("server response: %s", resp.Status) |
| 550 | } |
| 551 | |
| 552 | // isPerfFile checks if a file is in perf.data format. It also returns false |
| 553 | // if it encounters an error during the check. |
no outgoing calls
no test coverage detected
searching dependent graphs…