Skip to content

Commit

Permalink
fix: replace ioutil.readfile with os.readfile (#868)
Browse files Browse the repository at this point in the history
### summay

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

Signed-off-by: rfyiamcool <rfyiamcool@163.com>
  • Loading branch information
rfyiamcool authored Dec 7, 2023
1 parent 6f5d213 commit 286c896
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/filewatch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package main
import (
"flag"
"html/template"
"io/ioutil"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 286c896

Please sign in to comment.