func (c *Client) executeRequest(ctx context.Context, u string, bodyFunc func(body io.Reader) error) error {
	r, err := ctxhttp.Get(ctx, c.httpClient, u)
	if err != nil {
		return fmt.Errorf("ctxhttp.Get(ctx, client, %q): %v", u, err)
	}
	defer r.Body.Close()
	switch {
	case 200 <= r.StatusCode && r.StatusCode < 300:
		// OK.
	case r.StatusCode == http.StatusNotFound,
		r.StatusCode == http.StatusGone:
		// Treat both 404 Not Found and 410 Gone responses
		// from the proxy as a "not found" error category.
		return fmt.Errorf("ctxhttp.Get(ctx, client, %q): %w", u, derrors.NotFound)
	default:
		return fmt.Errorf("ctxhttp.Get(ctx, client, %q): unexpected status %d %s", u, r.StatusCode, r.Status)
	}
	return bodyFunc(r.Body)
}
// executeRequest executes an HTTP GET request for u, then calls the bodyFunc
// on the response body, if no error occurred.
executeRequest executes an HTTP GET request for u, then calls the bodyFunc
on the response body, if no error occurred.
// executeRequest executes an HTTP GET request for u then calls the bodyFunc // on the response body if no error occurred .
func (c *Client) executeRequest(ctx context.Context, u string, bodyFunc func(body io.Reader) error) error {
	r, err := ctxhttp.Get(ctx, c.httpClient, u)
	if err != nil {
		return fmt.Errorf("ctxhttp.Get(ctx, client, %q): %v", u, err)
	}
	defer r.Body.Close()
	switch {
	case 200 <= r.StatusCode && r.StatusCode < 300:
	case r.StatusCode == http.StatusNotFound,
		r.StatusCode == http.StatusGone:
		return fmt.Errorf("ctxhttp.Get(ctx, client, %q): %w", u, derrors.NotFound)
	default:
		return fmt.Errorf("ctxhttp.Get(ctx, client, %q): unexpected status %d %s", u, r.StatusCode, r.Status)
	}
	return bodyFunc(r.Body)
}
func ( c * Client ) executeRequest ( ctx context . Context , u string , bodyFunc func ( body io . Reader ) error ) error { r , err := ctxhttp . Get ( ctx , c . httpClient , u ) if err != nil { return fmt . Errorf ( " " , u , err ) } defer r . Body . Close ( ) switch { case 200 <= r . StatusCode && r . StatusCode < 300 : case r . StatusCode == http . StatusNotFound , r . StatusCode == http . StatusGone : return fmt . Errorf ( " " , u , derrors . NotFound ) default : return fmt . Errorf ( " " , u , r . StatusCode , r . Status ) } return bodyFunc ( r . Body ) }
executeRequest executes an HTTP GET request for u, then calls the bodyFunc
on the response body, if no error occurred.
executeRequest executes an HTTP GET request for u then calls the bodyFunc on the response body if no error occurred .
// OK. // Treat both 404 Not Found and 410 Gone responses // from the proxy as a "not found" error category.