优化代码

This commit is contained in:
GoEdgeLab
2022-08-04 11:41:42 +08:00
parent efdebedcb1
commit 1d4f1e78fc
16 changed files with 38 additions and 44 deletions

View File

@@ -10,7 +10,7 @@ import (
"github.com/TeaOSLab/EdgeAPI/internal/dnsclients/dnstypes"
"github.com/TeaOSLab/EdgeAPI/internal/errors"
"github.com/iwind/TeaGo/maps"
"io/ioutil"
"io"
"net/http"
"strconv"
"time"
@@ -180,5 +180,5 @@ func (this *CustomHTTPProvider) post(params maps.Map) (respData []byte, err erro
if resp.StatusCode != 200 {
return nil, errors.New("status should be 200, but got '" + strconv.Itoa(resp.StatusCode) + "'")
}
return ioutil.ReadAll(resp.Body)
return io.ReadAll(resp.Body)
}