mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-10-25 10:59:13 +08:00
chore: use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...))
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
@@ -39,7 +38,7 @@ func DownloadAndSaveFile(remoteUrl, dstFile string) (error) {
|
||||
if resp.StatusCode == http.StatusOK {
|
||||
_, err = io.Copy(out, resp.Body)
|
||||
}else{
|
||||
return errors.New(fmt.Sprintf("bad status: %s", resp.Status))
|
||||
return fmt.Errorf("bad status: %s", resp.Status)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user