fix: replace ioutil.readfile with os.readfile (#868)

### summay

`ioutil.ReadFile` is Deprecated, As of Go 1.16, this function simply
calls [os.ReadFile].

Signed-off-by: rfyiamcool <rfyiamcool@163.com>
This commit is contained in:
fengyun.rui 2023-12-07 12:58:12 +08:00 committed by GitHub
parent 6f5d2139f4
commit 286c896192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,6 @@ package main
import (
"flag"
"html/template"
"io/ioutil"
"log"
"net/http"
"os"
@ -50,7 +49,8 @@ func readFileIfModified(lastMod time.Time) ([]byte, time.Time, error) {
if !fi.ModTime().After(lastMod) {
return nil, lastMod, nil
}
p, err := ioutil.ReadFile(filepath.Clean(filename))
p, err := os.ReadFile(filepath.Clean(filename))
if err != nil {
return nil, fi.ModTime(), err
}