55 "crypto/x509"
66 "fmt"
77 "io"
8- "io/ioutil"
98 "net"
109 "net/http"
1110 "os"
@@ -117,7 +116,7 @@ func PostCustomDataWithPositionFuncWithTimeout(endpoint, params string, file *os
117116 path := config .GlobalConfig .CACertPath
118117 if len (path ) > 0 {
119118 pool := x509 .NewCertPool ()
120- ca , err := ioutil .ReadFile (path )
119+ ca , err := os .ReadFile (path )
121120 if err != nil {
122121 msg = err .Error ()
123122 return
@@ -148,7 +147,7 @@ func PostCustomDataWithPositionFuncWithTimeout(endpoint, params string, file *os
148147 }
149148
150149 defer resp .Body .Close ()
151- body , err := ioutil .ReadAll (resp .Body )
150+ body , err := io .ReadAll (resp .Body )
152151 if err != nil {
153152 msg = fmt .Sprintf ("PostData get resp err %s" , err .Error ())
154153 return
@@ -173,7 +172,7 @@ func GetData(endpoint string) (msg string, ok bool) {
173172 path := config .GlobalConfig .CACertPath
174173 if len (path ) > 0 {
175174 pool := x509 .NewCertPool ()
176- ca , err := ioutil .ReadFile (path )
175+ ca , err := os .ReadFile (path )
177176 if err != nil {
178177 msg = err .Error ()
179178 return
@@ -198,7 +197,7 @@ func GetData(endpoint string) (msg string, ok bool) {
198197 }
199198
200199 defer resp .Body .Close ()
201- body , err := ioutil .ReadAll (resp .Body )
200+ body , err := io .ReadAll (resp .Body )
202201 if err != nil {
203202 msg = fmt .Sprintf ("GetData get resp err %s" , err .Error ())
204203 return
0 commit comments