mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
chore: use errors.New to replace fmt.Errorf with no parameters (#4204)
Signed-off-by: RiceChuan <lc582041246@gmail.com>
This commit is contained in:
parent
d54d20abea
commit
b287d6419b
4 changed files with 15 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue