Skip to content

Commit

Permalink
fix: remove deprecated ioutil package
Browse files Browse the repository at this point in the history
Signed-off-by: magichan <[email protected]>
  • Loading branch information
magichan authored and Rory-Z committed Oct 18, 2023
1 parent 0782937 commit 86c6962
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sidecar/reloader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
Expand Down Expand Up @@ -116,7 +115,7 @@ func generateWatchedFileList(pluginConfigDir, licenseFilePath string) []string {
if licenseFilePath != "" {
fileList = append(fileList, licenseFilePath)
}
pluginConfigs, err := ioutil.ReadDir(pluginConfigDir)
pluginConfigs, err := os.ReadDir(pluginConfigDir)
if err != nil {
log.Printf("read dir err: %v", err)
return fileList
Expand Down Expand Up @@ -215,9 +214,10 @@ func requestWebhook(url url.URL, method string, bodys []byte, username, password
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)

body, err := io.ReadAll(resp.Body)
if err != nil {
log.Println("ioutil read error:", err)
log.Println("read resp body error:", err)
return
}
log.Println("http response url:", url.String())
Expand Down

0 comments on commit 86c6962

Please sign in to comment.