mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-04 13:52:26 +08:00
chore: replace ioutil -> io
This commit is contained in:
@@ -4,7 +4,7 @@ package tools
|
||||
import (
|
||||
"encoding/base64"
|
||||
htmpl "html/template"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
@@ -62,7 +62,7 @@ func GetAvatar(domain string) string {
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
data, err := ioutil.ReadAll(resp.Body)
|
||||
data, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return ""
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"regexp"
|
||||
"time"
|
||||
@@ -23,8 +23,8 @@ func EncryptPasswd(name, pass string) string {
|
||||
}
|
||||
|
||||
// ReadDirFiles 读取目录
|
||||
func ReadDirFiles(dir string, filter func(fi fs.FileInfo) bool) (files []string) {
|
||||
fileInfos, err := ioutil.ReadDir(dir)
|
||||
func ReadDirFiles(dir string, filter func(fi fs.DirEntry) bool) (files []string) {
|
||||
fileInfos, err := os.ReadDir(dir)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user