chore: use errors.New to replace fmt.Errorf with no parameters (#4204)

Signed-off-by: RiceChuan <lc582041246@gmail.com>
This commit is contained in:
leo 2024-12-24 13:17:00 +08:00 committed by GitHub
parent d54d20abea
commit b287d6419b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 12 deletions

View file

@ -3,6 +3,7 @@ package api
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"net/http"
@ -101,7 +102,7 @@ func fetchHTTPContent(target string) ([]byte, error) {
content, err := buf.ReadAllToBytes(resp.Body)
if err != nil {
return nil, fmt.Errorf("failed to read HTTP response")
return nil, errors.New("failed to read HTTP response")
}
return content, nil