chore: replace ioutil -> io

This commit is contained in:
henry.chen
2024-11-04 10:31:28 +08:00
parent 27bc610a31
commit 6e1965a764
8 changed files with 27 additions and 26 deletions

View File

@@ -6,7 +6,7 @@ import (
"context"
"fmt"
htemplate "html/template"
"io/ioutil"
"io"
"math/rand"
"net/http"
"strconv"
@@ -370,7 +370,7 @@ func handleBeaconPage(c *gin.Context) {
return
}
defer res.Body.Close()
data, err := ioutil.ReadAll(res.Body)
data, err := io.ReadAll(res.Body)
if err != nil {
logrus.Error("HandleBeaconPage.ReadAll: ", err)
return

View File

@@ -18,7 +18,7 @@ var htmlTmpl *template.Template
func init() {
htmlTmpl = template.New("eiblog").Funcs(tools.TplFuncMap)
root := filepath.Join(config.WorkDir, "website")
files := tools.ReadDirFiles(root, func(fi fs.FileInfo) bool {
files := tools.ReadDirFiles(root, func(fi fs.DirEntry) bool {
name := fi.Name()
if name == ".DS_Store" {
return true