remove redundant err check and just return

This commit is contained in:
Laurence 2024-04-12 16:38:12 +01:00
parent 01edb183c4
commit badbf9d1cb
No known key found for this signature in database
GPG key ID: B053BEE3478E8FEF

View file

@ -294,7 +294,7 @@ func collectPprofs() ([]byte, []byte, []byte) {
func collectPprof(h *http.Client, endpoint string) ([]byte, error) {
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("http://%s:%d/debug/pprof/%s", csConfig.Prometheus.ListenAddr, csConfig.Prometheus.ListenPort, endpoint), nil)
if err != nil {
return nil, fmt.Errorf("could not create request to get cpu profile: %s", err)
return nil, err
}
resp, err := h.Do(req)